Skip to content

Commit

Permalink
closes #11551 (#11693)
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 authored and Araq committed Jul 9, 2019
1 parent a85e20c commit eb059fa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/casestmt/tcasestmt.nim
Expand Up @@ -237,3 +237,16 @@ proc positiveOrNegative(num: int): string =
"zero" "zero"
else: else:
"impossible" "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 eb059fa

Please sign in to comment.