aboutsummaryrefslogtreecommitdiff
path: root/tests/misc.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2017-05-30 21:24:35 +1000
committerSteve Bennett <steveb@workware.net.au>2017-05-30 21:33:40 +1000
commit68b7a49c413b9a75e7a1958d80f0f18a3ab6e924 (patch)
tree69d45c7b05174ae796d0f16d6522207661d4b61a /tests/misc.test
parent8a0aae566304774210aaeaaac929efe3773b3c60 (diff)
downloadjimtcl-68b7a49c413b9a75e7a1958d80f0f18a3ab6e924.zip
jimtcl-68b7a49c413b9a75e7a1958d80f0f18a3ab6e924.tar.gz
jimtcl-68b7a49c413b9a75e7a1958d80f0f18a3ab6e924.tar.bz2
expr: Ensure that non-zero return codes are passed through
Non-zero return codes (e.g. break, continue, exit) were all being converted to the error code. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/misc.test')
-rw-r--r--tests/misc.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/misc.test b/tests/misc.test
index 6eeb648..29bd977 100644
--- a/tests/misc.test
+++ b/tests/misc.test
@@ -475,6 +475,19 @@ test jimexpr-2.5 "double ** operator" {
expr {$result in {unsupported 8.0}}
} 1
+test jimexpr-2.6 "exit in expression" {
+ # The inner 'exit 0' should propagate through the if to
+ # the outer catch
+ catch -exit {
+ set x 1
+ if {[catch {exit 0}] == 1} {
+ set x 2
+ } else {
+ set x 3
+ }
+ }]
+} 6
+
# This one is for test coverage of an unusual case
test jimobj-1.1 "duplicate obj with no dupIntRepProc" {
proc "x x" {} { return 2 }