blob: 68dacf3df738f32fcbe8a2f86e369e18ce32d45a (
plain) (
tree)
|
|
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
|