mirror of https://github.com/poanetwork/rox.git
fix(): fix stream
This commit is contained in:
parent
584a3832f9
commit
7f5dbac8b6
|
@ -247,7 +247,7 @@ defmodule Rox do
|
|||
Stream.resource(fn ->
|
||||
{:ok, iter } = :erocksdb.iterator(db, read_opts)
|
||||
{iter, :first}
|
||||
end, scan_or_decode, fn {iter,_} ->
|
||||
end, scan_or_decode, fn iter ->
|
||||
:erocksdb.iterator_close(iter)
|
||||
end)
|
||||
end
|
||||
|
|
|
@ -30,4 +30,13 @@ defmodule RoxTest do
|
|||
|
||||
assert count == 1
|
||||
end
|
||||
|
||||
test "stream", %{db: db} do
|
||||
:ok = Rox.put(db, "key", "val")
|
||||
|
||||
count = Rox.stream(db)
|
||||
|> Enum.count
|
||||
|
||||
assert count == 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue