diff options
author | Alex Auvolat <alex@adnab.me> | 2018-09-11 17:21:14 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2018-09-11 17:21:14 +0200 |
commit | 9695231c327e052c5d5bc61197cc8222599fb91a (patch) | |
tree | c0d0f247269729658ad354a32475f34fa7268ed1 /shard/test/mst_test.exs | |
parent | a033c82a3c656a8f53feb60b5b149680771ac247 (diff) | |
download | shard-9695231c327e052c5d5bc61197cc8222599fb91a.tar.gz shard-9695231c327e052c5d5bc61197cc8222599fb91a.zip |
Block store dependency management & caching (NOT TESTED)
Diffstat (limited to 'shard/test/mst_test.exs')
-rw-r--r-- | shard/test/mst_test.exs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/shard/test/mst_test.exs b/shard/test/mst_test.exs index c1758ad..cf5a898 100644 --- a/shard/test/mst_test.exs +++ b/shard/test/mst_test.exs @@ -174,24 +174,4 @@ defmodule ShardTest.MST do assert MST.last(mg1, nil, 2000) == all_items end - test "merkle search tree 8: MST.merge callback" do - items1 = (for i <- 1..1000, do: i*2+40) - items2 = (for i <- 1..1000, do: i*3) - - y = Enum.reduce(items1, %MST{}, fn i, acc -> MST.insert(acc, i) end) - z = Enum.reduce(items2, %MST{}, fn i, acc -> MST.insert(acc, i) end) - - {:ok, cb_called} = Agent.start_link fn -> [] end - - cb = fn i, true -> Agent.update(cb_called, fn x -> [i | x] end) end - mg = MST.merge(y, z, cb) - - cb_vals = Agent.get cb_called, &(&1) - expected = MapSet.difference(MapSet.new(items2), MapSet.new(items1)) - |> MapSet.to_list - |> Enum.sort - |> Enum.reverse - assert expected == cb_vals - end - end |