mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-02 21:53:05 +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
|
||||
without path =? self.findPath(key), error:
|
||||
return failure error
|
||||
echo "query:key: ", key
|
||||
|
||||
let basePath =
|
||||
# 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]]
|
||||
): ?!DbQueryResponse[K, V] =
|
||||
let root = $(handle.env.self.root)
|
||||
# echo "FS:root: ", root
|
||||
echo "FS:root: ", root
|
||||
|
||||
for path in root.dirIter():
|
||||
# echo "FS:path: ", path
|
||||
echo "FS:path: ", path
|
||||
if handle.cancel:
|
||||
# echo "FS:CANCELLED!"
|
||||
break
|
||||
|
||||
@ -161,9 +161,11 @@ template queryTests*(
|
||||
handle = ds.query(q).tryGet
|
||||
let
|
||||
res = handle.iter().toSeq().mapIt(block:
|
||||
echo "RES: ", it.repr
|
||||
echo "\nRES: ", it.repr
|
||||
# quit(1)
|
||||
it.tryGet()
|
||||
)
|
||||
)
|
||||
# ).filterIt(it.isOk).mapIt(it.tryGet())
|
||||
|
||||
check:
|
||||
res.len == 2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user