summary refs log tree commit diff stats
path: root/tests/init/tuninit1.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-01-13 02:10:03 +0100
committerAraq <rumpf_a@web.de>2014-01-13 02:10:03 +0100
commit20b5f31c03fb556ec0aa2428a40adbac004d8987 (patch)
tree58086941e7d6bb8f480ca1173a95722ada9435b2 /tests/init/tuninit1.nim
parent51ee524109cf7e3e86c676bc1676063a01bfd979 (diff)
downloadNim-20b5f31c03fb556ec0aa2428a40adbac004d8987.tar.gz
new tester; all tests categorized
Diffstat (limited to 'tests/init/tuninit1.nim')
-rw-r--r--tests/init/tuninit1.nim36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/init/tuninit1.nim b/tests/init/tuninit1.nim
new file mode 100644
index 000000000..2a994b187
--- /dev/null
+++ b/tests/init/tuninit1.nim
@@ -0,0 +1,36 @@
+discard """
+  errormsg: "'y' might not have been initialized"
+  line:34
+"""
+
+import strutils
+
+{.warning[Uninit]:on.}
+
+proc p =
+  var x, y, z: int
+  if stdin.readLine == "true":
+    x = 34
+    
+    while false:
+      y = 999
+      break
+      
+    while true:
+      if x == 12: break
+      y = 9999
+      
+    try:
+      z = parseInt("1233")
+    except E_Base:
+      case x
+      of 34: z = 123
+      of 13: z = 34
+      else: z = 8
+  else:
+    y = 3444
+    x = 3111
+    z = 0
+  echo x, y, z
+  
+p()