diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2010-11-03 11:08:20 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2010-11-03 11:08:20 (GMT) |
commit | d4d95330eb4e444b9ed5cbdfbad4fa6e887fd2b9 (patch) | |
tree | 544fadeed0b36a19c7d51de61efce0a1365c09ab /tests | |
parent | 4ac4e5c0f9920027f560c0c6234a8249f8724ec5 (diff) | |
download | tcl-d4d95330eb4e444b9ed5cbdfbad4fa6e887fd2b9.zip tcl-d4d95330eb4e444b9ed5cbdfbad4fa6e887fd2b9.tar.gz tcl-d4d95330eb4e444b9ed5cbdfbad4fa6e887fd2b9.tar.bz2 |
* generic/tclCmdMZ.c (TryPostBody): Ensure that errors when setting
* tests/error.test (error-19.1[12]): message/opt capture variables get
reflected properly to the caller.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/error.test | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/tests/error.test b/tests/error.test index 6e2aee5..77a96fd 100644 --- a/tests/error.test +++ b/tests/error.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: error.test,v 1.34 2010/10/20 20:52:28 ferrieux Exp $ +# RCS: @(#) $Id: error.test,v 1.35 2010/11/03 11:08:21 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -912,6 +912,50 @@ test error-19.10 {compiled try with chained clauses} -setup { } -cleanup { unset RES } -result {handler {ok good finally}} +test error-19.11 {compiled try and errors on variable write} -setup { + set RES {} +} -body { + apply {{} { + array set foo {bar boo} + set bar unset + catch { + try { + addmsg body + return a + } on return {bar foo} { + addmsg handler + return b + } finally { + addmsg finally,$bar + } + } msg + addmsg $msg + } ::tcl::test::error} +} -cleanup { + unset RES +} -result {body finally,a {can't set "foo": variable is array}} +test error-19.12 {interpreted try and errors on variable write} -setup { + set RES {} +} -body { + apply {try { + array set foo {bar boo} + set bar unset + catch { + $try { + addmsg body + return a + } on return {bar foo} { + addmsg handler + return b + } finally { + addmsg finally,$bar + } + } msg + addmsg $msg + } ::tcl::test::error} try +} -cleanup { + unset RES +} -result {body finally,a {can't set "foo": variable is array}} rename addmsg {} # FIXME test what vars get set on fallthough ... what is the correct behavior? |