Skip to content
Permalink
Browse files

closes #11551 (#11693)

  • Loading branch information...
krux02 authored and Araq committed Jul 9, 2019
1 parent a85e20c commit eb059fa8488041fcde8fda761a4634aaeecc4ce1
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/casestmt/tcasestmt.nim
@@ -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.
You can’t perform that action at this time.