diff options
Diffstat (limited to 'shard/test/mkllst_test.exs')
-rw-r--r-- | shard/test/mkllst_test.exs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shard/test/mkllst_test.exs b/shard/test/mkllst_test.exs new file mode 100644 index 0000000..68dacf3 --- /dev/null +++ b/shard/test/mkllst_test.exs @@ -0,0 +1,18 @@ +defmodule ShardTest.MklLst do + use ExUnit.Case + doctest Shard.Application + + test "merkle list" do + alias SData.MerkleList, as: ML + + mkl = ML.new(&SData.cmp_ts_str/2) + + {:ok, [], nil} = ML.read(mkl) + + mkl = ML.insert(mkl, {12, "aa, bb"}) + mkl = ML.insert_many(mkl, [{14, "qwerty"}, {8, "haha"}]) + mkl = ML.insert(mkl, {14, "qwerty"}) + {:ok, list, nil} = ML.read(mkl, nil, nil) + assert length(list) == 3 + end +end |