mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-06 23:53:09 +00:00
refactor - tests
This commit is contained in:
parent
dcb70ca429
commit
0f0e113f4f
@ -190,6 +190,7 @@ proc query*[K,V](
|
|||||||
let key = query.key
|
let key = query.key
|
||||||
without path =? self.findPath(key), error:
|
without path =? self.findPath(key), error:
|
||||||
return failure error
|
return failure error
|
||||||
|
echo "query:key: ", key
|
||||||
|
|
||||||
let basePath =
|
let basePath =
|
||||||
# it there is a file in the directory
|
# it there is a file in the directory
|
||||||
@ -211,10 +212,10 @@ proc close*[K,V](handle: var DbQueryHandle[K,V,FsQueryEnv[K,V]]) =
|
|||||||
iterator iter*[K, V](handle: var DbQueryHandle[K, V, FsQueryEnv[K,V]]
|
iterator iter*[K, V](handle: var DbQueryHandle[K, V, FsQueryEnv[K,V]]
|
||||||
): ?!DbQueryResponse[K, V] =
|
): ?!DbQueryResponse[K, V] =
|
||||||
let root = $(handle.env.self.root)
|
let root = $(handle.env.self.root)
|
||||||
# echo "FS:root: ", root
|
echo "FS:root: ", root
|
||||||
|
|
||||||
for path in root.dirIter():
|
for path in root.dirIter():
|
||||||
# echo "FS:path: ", path
|
echo "FS:path: ", path
|
||||||
if handle.cancel:
|
if handle.cancel:
|
||||||
# echo "FS:CANCELLED!"
|
# echo "FS:CANCELLED!"
|
||||||
break
|
break
|
||||||
|
|||||||
@ -161,9 +161,11 @@ template queryTests*(
|
|||||||
handle = ds.query(q).tryGet
|
handle = ds.query(q).tryGet
|
||||||
let
|
let
|
||||||
res = handle.iter().toSeq().mapIt(block:
|
res = handle.iter().toSeq().mapIt(block:
|
||||||
echo "RES: ", it.repr
|
echo "\nRES: ", it.repr
|
||||||
|
# quit(1)
|
||||||
it.tryGet()
|
it.tryGet()
|
||||||
)
|
)
|
||||||
|
# ).filterIt(it.isOk).mapIt(it.tryGet())
|
||||||
|
|
||||||
check:
|
check:
|
||||||
res.len == 2
|
res.len == 2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user