summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/incr-old.test5
-rw-r--r--tests/incr.test16
2 files changed, 18 insertions, 3 deletions
diff --git a/tests/incr-old.test b/tests/incr-old.test
index 0344c42..1c78b82 100644
--- a/tests/incr-old.test
+++ b/tests/incr-old.test
@@ -13,7 +13,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-old.test,v 1.5 2000/04/10 17:19:00 ericm Exp $
+# RCS: @(#) $Id: incr-old.test,v 1.6 2003/02/06 22:44:58 mdejong Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -62,7 +62,8 @@ test incr-old-2.5 {incr errors} {
set x 123
list [catch {incr x 1a} msg] $msg $errorInfo
} {1 {expected integer but got "1a"} {expected integer but got "1a"
- while executing
+ (reading increment)
+ invoked from within
"incr x 1a"}}
test incr-old-2.6 {incr errors} {
proc readonly args {error "variable is read-only"}
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