summary refs log tree commit diff stats
path: root/tests/casestmt
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-07-09 19:38:38 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-07-09 19:38:38 +0200
commiteb059fa8488041fcde8fda761a4634aaeecc4ce1 (patch)
treee1652f80f7d33cea9e8081c821e603155d6a0429 /tests/casestmt
parenta85e20c1258dd1b29c15e785e570c4b002ed1100 (diff)
downloadNim-eb059fa8488041fcde8fda761a4634aaeecc4ce1.tar.gz
closes #11551 (#11693)
Diffstat (limited to 'tests/casestmt')
-rw-r--r--tests/casestmt/tcasestmt.nim13
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"