Skip to content

Commit

Permalink
fix test for define
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 6, 2024
1 parent 8122d96 commit 3d5b6e3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_try.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ test "::=?":
import options
test ":=? based on option":
proc foo(x: Option[int]): int =
some(n) :=? x:
n + 1
when defined(assignsMatchBreakpoint):
some(n) :=? x:
result = n + 1
else:
result = 0
else:
0
some(n) :=? x:
n + 1
else:
0

check foo(some(0)) == 1
check foo(none(int)) == 0
Expand Down

0 comments on commit 3d5b6e3

Please sign in to comment.