diff options
author | mdejong <mdejong@noemail.net> | 2003-02-06 22:44:56 (GMT) |
---|---|---|
committer | mdejong <mdejong@noemail.net> | 2003-02-06 22:44:56 (GMT) |
commit | dcf2a33bf8f5612d2e19a568040fb513e2a70b33 (patch) | |
tree | df7b90a9df2be40d32ff63faf11c6adc5c8ea2fd /tests/incr.test | |
parent | 9dcd98fc272d9d04d7eac176f0c07f0039c411be (diff) | |
download | tcl-dcf2a33bf8f5612d2e19a568040fb513e2a70b33.zip tcl-dcf2a33bf8f5612d2e19a568040fb513e2a70b33.tar.gz tcl-dcf2a33bf8f5612d2e19a568040fb513e2a70b33.tar.bz2 |
* generic/tclExecute.c (TclExecuteByteCode): When an
error is encountered reading the increment value during
a compiled call to incr, add a "(reading increment)"
error string to the errorInfo variable. This makes
the errorInfo variable set by the compiled incr command
match the value set by the non-compiled version.
* tests/incr-old.test: Change errorInfo result for
the compiled incr command case to match the modified
implementation.
* tests/incr.test: Add tests to make sure the compiled
and non-compiled errorInfo messages are the same.
FossilOrigin-Name: a84d591f121bfbf5d45ee15c234591b5b4a44fac
Diffstat (limited to 'tests/incr.test')
-rw-r--r-- | tests/incr.test | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/incr.test b/tests/incr.test index f3ea408..1aeea59 100644 --- a/tests/incr.test +++ b/tests/incr.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: incr.test,v 1.6 2000/04/10 17:19:00 ericm Exp $ +# RCS: @(#) $Id: incr.test,v 1.7 2003/02/06 22:44:58 mdejong Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -502,6 +502,20 @@ test incr-2.29 {incr command (not compiled): runtime error, bad variable value} set x " - " list [catch {$z x 1} msg] $msg } {1 {expected integer but got " - "}} +test incr-2.30 {incr command (not compiled): bad increment} { + set z incr + set x 0 + list [catch {$z x 1a} msg] $msg $errorInfo +} {1 {expected integer but got "1a"} {expected integer but got "1a" + (reading increment) + invoked from within +"$z x 1a"}} +test incr-2.31 {incr command (compiled): bad increment} { + list [catch {incr x 1a} msg] $msg $errorInfo +} {1 {expected integer but got "1a"} {expected integer but got "1a" + (reading increment) + invoked from within +"incr x 1a"}} # cleanup ::tcltest::cleanupTests |