From de0ad2aa0c927977251ece4776d3da88757a2389 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 20 Jun 2022 15:34:23 +0200 Subject: [PATCH] Additional test for nested without statements --- testmodules/result/test.nim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testmodules/result/test.nim b/testmodules/result/test.nim index 7d3c2e4..58d260c 100644 --- a/testmodules/result/test.nim +++ b/testmodules/result/test.nim @@ -274,6 +274,13 @@ suite "result": test(int) + test "without statements can be nested": + without a =? int.failure "error1", e1: + without b =? int.failure "error2", e2: + check e1.msg == "error1" + check e2.msg == "error2" + check e1.msg == "error1" + test "catch can be used to convert exceptions to results": check parseInt("42").catch == 42.success check parseInt("foo").catch.error of ValueError