summary refs log tree commit diff stats
path: root/tests/run/tvarious1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/tvarious1.nim')
-rw-r--r--tests/run/tvarious1.nim14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/run/tvarious1.nim b/tests/run/tvarious1.nim
index 9dd4af606..6e4612ae3 100644
--- a/tests/run/tvarious1.nim
+++ b/tests/run/tvarious1.nim
@@ -2,7 +2,8 @@ discard """
   file: "tlenopenarray.nim"
   output: '''1
 0
-Whopie'''
+Whopie
+12'''
 """
 
 echo len([1_000_000]) #OUT 1
@@ -27,3 +28,14 @@ var w = TWidget(names: initQueue[string]())
 add(w.names, "Whopie")
 
 for n in w.names: echo(n)
+
+# bug #681
+
+type TSomeRange = object
+  hour: range[0..23]
+
+var value: string
+var val12 = TSomeRange(hour: 12)
+
+value = $(if val12.hour > 12: val12.hour - 12 else: val12.hour)
+echo value