summaryrefslogtreecommitdiffstats
path: root/tests/incr.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/incr.test')
-rw-r--r--tests/incr.test28
1 files changed, 11 insertions, 17 deletions
diff --git a/tests/incr.test b/tests/incr.test
index 07526c4..3bd1541 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.11 2004/11/03 17:16:05 dgp Exp $
+# RCS: @(#) $Id: incr.test,v 1.12 2006/02/09 17:34:42 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -87,9 +87,8 @@ test incr-1.13 {TclCompileIncrCmd: simple but new (unknown) local name} {
proc p {} {
incr bar
}
- catch {p} msg
- set msg
-} {can't read "bar": no such variable}
+ p
+} 1
test incr-1.14 {TclCompileIncrCmd: simple local name, >255 locals} {
proc 260locals {} {
# create 260 locals
@@ -211,11 +210,9 @@ test incr-1.25 {TclCompileIncrCmd: too many arguments} {
test incr-1.26 {TclCompileIncrCmd: runtime error, bad variable name} {
- list [catch {incr {"foo}} msg] $msg $errorInfo
-} {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable
- (reading value of variable to increment)
- invoked from within
-"incr {"foo}"}}
+ unset -nocomplain {"foo}
+ incr {"foo}
+} 1
test incr-1.27 {TclCompileIncrCmd: runtime error, bad variable name} -body {
list [catch {incr [set]} msg] $msg $errorInfo
} -match glob -result {1 {wrong # args: should be "set varName ?newValue?"} {wrong # args: should be "set varName ?newValue?"
@@ -331,9 +328,8 @@ test incr-2.13 {incr command (not compiled): simple but new (unknown) local name
set z incr
$z bar
}
- catch {p} msg
- set msg
-} {can't read "bar": no such variable}
+ p
+} 1
test incr-2.14 {incr command (not compiled): simple local name, >255 locals} {
proc 260locals {} {
set z incr
@@ -467,12 +463,10 @@ test incr-2.25 {incr command (not compiled): too many arguments} {
test incr-2.26 {incr command (not compiled): runtime error, bad variable name} {
+ unset -nocomplain {"foo}
set z incr
- list [catch {$z {"foo}} msg] $msg $errorInfo
-} {1 {can't read ""foo": no such variable} {can't read ""foo": no such variable
- (reading value of variable to increment)
- invoked from within
-"$z {"foo}"}}
+ $z {"foo}
+} 1
test incr-2.27 {incr command (not compiled): runtime error, bad variable name} -body {
set z incr
list [catch {$z [set]} msg] $msg $errorInfo