defmodule ShardTest.MklLst do
use ExUnit.Case
doctest Shard.Application
test "merkle list" do
{:ok, pid} = GenServer.start(SData.MerkleList, &SData.MerkleList.cmp_ts_str/2)
{:ok, [], nil} = GenServer.call(pid, {:read, nil, nil})
GenServer.cast(pid, {:insert, {12, "aa, bb"}})
GenServer.cast(pid, {:insert_many, [{14, "qwerty"}, {8, "haha"}]})
GenServer.cast(pid, {:insert, {14, "qwerty"}})
{:ok, list, nil} = GenServer.call(pid, {:read, nil, nil})
assert length(list) == 3
end
end