summary refs log tree commit diff stats
path: root/tests/exception/texceptionbreak.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2014-02-17 00:48:10 +0200
committerZahary Karadjov <zahary@gmail.com>2014-02-17 00:48:10 +0200
commit9a41db7d7abaf92dbdef425605f68454d48b22b2 (patch)
tree309383a42d07cc62ebffca6c97f75e335dd3614e /tests/exception/texceptionbreak.nim
parentb80503814d3ad37023b27cc8b2d78aed0c10bfcb (diff)
parent5cd9b035b40f11a950d37695d75f0981b5c13fbe (diff)
downloadNim-9a41db7d7abaf92dbdef425605f68454d48b22b2.tar.gz
Merge branch 'devel' of gh:/Araq/Nimrod into devel
Diffstat (limited to 'tests/exception/texceptionbreak.nim')
-rw-r--r--tests/exception/texceptionbreak.nim45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/exception/texceptionbreak.nim b/tests/exception/texceptionbreak.nim
new file mode 100644
index 000000000..76e986787
--- /dev/null
+++ b/tests/exception/texceptionbreak.nim
@@ -0,0 +1,45 @@
+discard """
+  file: "tnestedbreak.nim"
+  output: "1\n2\n3\n4"
+"""
+
+# First variety
+try:
+  raise newException(EOS, "Problem")
+except EOS:
+  for y in [1, 2, 3]:
+    discard
+  try:
+    discard
+  except EOS:
+    discard
+echo "1"
+
+# Second Variety
+try:
+  raise newException(EOS, "Problem")
+except EOS:
+  for y in [1, 2, 3]:
+    discard
+  for y in [1, 2, 3]:
+    discard
+
+echo "2"
+
+# Third Variety
+try:
+  raise newException(EOS, "Problem")
+except EOS:
+  block:
+    break
+
+echo "3"
+
+# Fourth Variety
+block:
+  try:
+    raise newException(EOS, "Problem")
+  except EOS:
+    break
+
+echo "4"
\ No newline at end of file