diff options
author | Arne Döring <arne.doering@gmx.net> | 2019-07-09 19:38:38 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-07-09 19:38:38 +0200 |
commit | eb059fa8488041fcde8fda761a4634aaeecc4ce1 (patch) | |
tree | e1652f80f7d33cea9e8081c821e603155d6a0429 /tests/casestmt | |
parent | a85e20c1258dd1b29c15e785e570c4b002ed1100 (diff) | |
download | Nim-eb059fa8488041fcde8fda761a4634aaeecc4ce1.tar.gz |
closes #11551 (#11693)
Diffstat (limited to 'tests/casestmt')
-rw-r--r-- | tests/casestmt/tcasestmt.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/casestmt/tcasestmt.nim b/tests/casestmt/tcasestmt.nim index d86b3b0dd..1efa46e8e 100644 --- a/tests/casestmt/tcasestmt.nim +++ b/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" |