Skip to content
Permalink
Browse files

closes nim-lang#11551

  • Loading branch information...
krux02 committed Jul 9, 2019
1 parent 11dad68 commit fdcfde1e418af48fd949af9bfbddb11f1ceb2e08
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/casestmt/tcasestmt.nim
@@ -237,3 +237,16 @@ proc positiveOrNegative(num: int): string =
"zero"
else:
"impossible"

#issue #11551

proc negativeOrNot(num: int): string =
result = case num
of low(int) .. -1:
"negative"
else:
"zero or positive"

doAssert negativeOrNot(-1) == "negative"
doAssert negativeOrNot(10000000) == "zero or positive"
doAssert negativeOrNot(0) == "zero or positive"

0 comments on commit fdcfde1

Please sign in to comment.
You can’t perform that action at this time.