diff --git a/tests/string-set-tests b/tests/string-set-tests new file mode 100755 index 0000000..1fae262 Binary files /dev/null and b/tests/string-set-tests differ diff --git a/tests/string-set-tests.sml b/tests/string-set-tests.sml index f3111f7..9b7a57d 100644 --- a/tests/string-set-tests.sml +++ b/tests/string-set-tests.sml @@ -50,10 +50,26 @@ struct print "StringSet.getPrefixList passed all tests\n" end + fun remove1 () = + let + val trie = StringSet.fromList ["a", "ab", "abc"] + + val _ = assertTrue (StringSet.exists ("a", trie), "a exists before remove1") + + val trie = StringSet.remove ("a", trie) + val _ = assertFalse (StringSet.exists ("a", trie), "a does not exist after remove1") + + val _ = assertTrue (StringSet.exists ("ab", trie), "ab still exists after remove1") + val _ = assertTrue (StringSet.exists ("abc", trie), "abc still exists after remove1") + in + print "StringSet.remove: passed remove1\n" + end + fun run () = let val _ = testExists () val _ = testGetPrefixList () + val _ = remove1 () in () end