summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-07-05 22:45:32 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-07-05 22:45:32 +0200
commit7d5d9f7703901e092422d682f7ab21995cfa1122 (patch)
tree8d73bdb3795c5d8f82e9027f3277f97f3b71bc3c /tests
parent176eaf5c90579d76c60dcebbfea38c02a5b4d014 (diff)
downloadNim-7d5d9f7703901e092422d682f7ab21995cfa1122.tar.gz
introduce internal Int128 type, use it to fix case stmt checks (#11652)
* initial version of int128
* use int128 in case stmt
* fixes #11552
Diffstat (limited to 'tests')
-rw-r--r--tests/casestmt/tcasestmt.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/casestmt/tcasestmt.nim b/tests/casestmt/tcasestmt.nim
index 465080e84..d86b3b0dd 100644
--- a/tests/casestmt/tcasestmt.nim
+++ b/tests/casestmt/tcasestmt.nim
@@ -226,3 +226,14 @@ block tcasestm:
         true
       else: raise newException(ValueError, "Invalid")
   ))
+
+#issue #11552
+
+proc positiveOrNegative(num: int): string =
+  result = case num
+  of (low(int)+2) .. -1:
+    "negative"
+  of 0:
+    "zero"
+  else:
+    "impossible"