|
@@ -32,6 +32,7 @@ defmodule BPE.Test do
|
|
assert :lists.reverse(c) == KVS.reader(x2, :args)
|
|
assert :lists.reverse(c) == KVS.reader(x2, :args)
|
|
|
|
|
|
_ ->
|
|
_ ->
|
|
|
|
+ # mnesia doesn't support `all` over feeds (only for tables)
|
|
[]
|
|
[]
|
|
end
|
|
end
|
|
|
|
|
|
@@ -40,6 +41,26 @@ defmodule BPE.Test do
|
|
assert x == length(b)
|
|
assert x == length(b)
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+ test "sym" do
|
|
|
|
+ id = {:sym, :kvs.seq([], [])}
|
|
|
|
+ :kvs.save(:kvs.writer(id))
|
|
|
|
+ x = 5
|
|
|
|
+
|
|
|
|
+ :lists.map(
|
|
|
|
+ fn
|
|
|
|
+ z ->
|
|
|
|
+ :kvs.remove(KVS.writer(z, :cache), id)
|
|
|
|
+ end, :lists.map(
|
|
|
|
+ fn _ ->
|
|
|
|
+ :kvs.save(:kvs.add(KVS.writer(:kvs.writer(id), args: {:"$msg", [], [], [], [], []})))
|
|
|
|
+ end,
|
|
|
|
+ :lists.seq(1, x)
|
|
|
|
+ )
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ {:ok, KVS.writer(count: 0)} = :kvs.get(:writer, id)
|
|
|
|
+ end
|
|
|
|
+
|
|
test "take" do
|
|
test "take" do
|
|
id = {:partial, :kvs.seq([], [])}
|
|
id = {:partial, :kvs.seq([], [])}
|
|
x = 5
|
|
x = 5
|
|
@@ -88,6 +109,6 @@ defmodule BPE.Test do
|
|
IO.inspect({cache, t, a})
|
|
IO.inspect({cache, t, a})
|
|
assert length(a) == 1
|
|
assert length(a) == 1
|
|
|
|
|
|
- assert :lists.reverse(z1++z2++z3) == :kvs.feed(id)
|
|
|
|
|
|
+ assert :lists.reverse(z1 ++ z2 ++ z3) == :kvs.feed(id)
|
|
end
|
|
end
|
|
end
|
|
end
|