From e2e31e07b35e8d7481c2cfc8b1f8c479050916b6 Mon Sep 17 00:00:00 2001 From: Tomasz Bekas Date: Wed, 20 Dec 2023 09:09:06 +0100 Subject: [PATCH] Remove fail() --- tests/datastore/modifycommontests.nim | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/datastore/modifycommontests.nim b/tests/datastore/modifycommontests.nim index 054e6ab..332e8bb 100644 --- a/tests/datastore/modifycommontests.nim +++ b/tests/datastore/modifycommontests.nim @@ -26,7 +26,7 @@ proc modifyTests*( let errMsg = (await op).errorOption.map((err) => err.msg) - check none(string) == errMsg + require none(string) == errMsg proc incAsyncFn(maybeBytes: ?seq[byte]): Future[?seq[byte]] {.async.} = await sleepAsync(2.millis) # allows interleaving @@ -124,9 +124,5 @@ proc modifyTests*( let res = await ds.modify(key, throwing) - if err =? res.errorOption: - check: - err.msg.contains("some error msg") - else: - # result was not an error - fail() + check: + res.errorOption.map((err) => err.msg) == some("some error msg")