summary refs log tree commit diff stats
path: root/tests/exception
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-08-14 19:08:01 +0800
committerGitHub <noreply@github.com>2023-08-14 13:08:01 +0200
commit09d0fda7fde69087c75a102b219d5eebf1b86db2 (patch)
treecbbccf0ea9b996cce2fab04a7f78c27bd1a836d9 /tests/exception
parent7bb2462d06b039b70e13b68ee2b23c39a881ca26 (diff)
downloadNim-09d0fda7fde69087c75a102b219d5eebf1b86db2.tar.gz
fixes #22469; generates nimTestErrorFlag for top level statements (#22472)
fixes #22469; generates `nimTestErrorFlag` for top level statements
Diffstat (limited to 'tests/exception')
-rw-r--r--tests/exception/m22469.nim4
-rw-r--r--tests/exception/t22469.nim16
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/exception/m22469.nim b/tests/exception/m22469.nim
new file mode 100644
index 000000000..201698701
--- /dev/null
+++ b/tests/exception/m22469.nim
@@ -0,0 +1,4 @@
+# ModuleB
+echo "First top-level statement of ModuleB"
+echo high(int) + 1
+echo "ModuleB last statement"
\ No newline at end of file
diff --git a/tests/exception/t22469.nim b/tests/exception/t22469.nim
new file mode 100644
index 000000000..a76c74967
--- /dev/null
+++ b/tests/exception/t22469.nim
@@ -0,0 +1,16 @@
+discard """
+  exitcode: 1
+  output: '''
+First top-level statement of ModuleB
+m22469.nim(3)            m22469
+fatal.nim(53)            sysFatal
+Error: unhandled exception: over- or underflow [OverflowDefect]
+'''
+"""
+
+# bug #22469
+
+# ModuleA
+import m22469
+echo "ModuleA about to have exception"
+echo high(int) + 1