Browse files

Add the hamt test.

  • Loading branch information...
1 parent 4f43c8d commit 1a4e083027918f157ec79fc73de4278654000d73 @jlouis committed Feb 18, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/bench_map.erl
View
12 src/bench_map.erl
@@ -20,6 +20,7 @@ run_prof() ->
run() ->
[
+ {hamt, hamt_test()},
{patricia, patricia_test()},
{sets, set_test()},
{dict, dict_test()},
@@ -71,6 +72,13 @@ test_gb_sets_words(Words, Set) ->
end,
Words).
+test_hamt_words(Words, Tree) ->
+ lists:foreach(
+ fun(Word) ->
+ true = hamt:is_element(Word, Tree)
+ end, Words),
+ false = hamt:is_element(notthere, Tree).
+
test_patricia_words(Words, Tree) ->
lists:foreach(
fun(Word) ->
@@ -150,6 +158,10 @@ patricia_test() ->
end,
fun test_patricia_words/2).
+hamt_test() ->
+ test_map(fun hamt:from_list/1,
+ fun test_hamt_words/2).
+
-ifdef(EUNIT).
-ifdef(EQC).

0 comments on commit 1a4e083

Please sign in to comment.