aboutsummaryrefslogtreecommitdiff
path: root/shard/test/mkllst_test.exs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-09-01 16:06:23 +0200
committerAlex Auvolat <alex@adnab.me>2018-09-01 16:06:23 +0200
commitc6ec33d6e612168e14d77007915a4ea423c55a2e (patch)
tree8b5645651a0cc991b8ac9c68c388d84c8dbe73d2 /shard/test/mkllst_test.exs
parent1a0ef154a421af60f6d57dfe861dacb844a7d142 (diff)
downloadshard-c6ec33d6e612168e14d77007915a4ea423c55a2e.tar.gz
shard-c6ec33d6e612168e14d77007915a4ea423c55a2e.zip
Move everything to subdirectory
Diffstat (limited to 'shard/test/mkllst_test.exs')
-rw-r--r--shard/test/mkllst_test.exs18
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