mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-05 23:23:10 +00:00
update tests
This commit is contained in:
parent
c3353bd665
commit
3825899b0b
@ -211,7 +211,7 @@ proc newThreadProxyDatastore*(
|
||||
|
||||
try:
|
||||
value[].ds = ds
|
||||
value[].tp = Taskpool.new(num_threads = 6)
|
||||
value[].tp = Taskpool.new(num_threads = 2)
|
||||
except Exception as exc:
|
||||
return err((ref DatastoreError)(msg: exc.msg))
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ template checkNotNil(p: typed) =
|
||||
|
||||
|
||||
when not defined(datastoreEchoedThread):
|
||||
proc echoed*(vals: varargs[string]) =
|
||||
template echoed*(vals: varargs[untyped]) =
|
||||
discard
|
||||
else:
|
||||
import std/terminal
|
||||
|
||||
@ -52,12 +52,24 @@ suite "Test Basic ThreadProxyDatastore":
|
||||
val &= char(c)
|
||||
# print "get res2: ", $val
|
||||
|
||||
suite "Test Basics":
|
||||
var
|
||||
mem = MemoryDatastore.new()
|
||||
sds = newThreadProxyDatastore(mem).expect("should work")
|
||||
|
||||
let
|
||||
key = Key.init("/a/b").tryGet()
|
||||
bytes = "some bytes".toBytes
|
||||
otherBytes = "some other bytes".toBytes
|
||||
|
||||
# echo "\n\n=== put cancel ==="
|
||||
# # let res1 = await sds.put(key1, "value for 1".toBytes())
|
||||
# let res3 = sds.put(key1, "value for 1".toBytes())
|
||||
# res3.cancel()
|
||||
# # print "res3: ", res3
|
||||
|
||||
basicStoreTests(sds, key, bytes, otherBytes)
|
||||
|
||||
# suite "Test Basic ThreadProxyDatastore":
|
||||
|
||||
# var
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user