summaryrefslogtreecommitdiffstats
path: root/tests/subst.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/subst.test')
-rw-r--r--tests/subst.test30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/subst.test b/tests/subst.test
index 77a3df7..933b1c6 100644
--- a/tests/subst.test
+++ b/tests/subst.test
@@ -12,7 +12,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
+ package require tcltest 2.1
namespace import -force ::tcltest::*
}
@@ -160,12 +160,12 @@ test subst-8.5 {return in a subst} {
test subst-8.6 {return in a subst} {
list [catch {subst {foo [return {x}; bogus code bar}} msg] $msg
} {1 {missing close-bracket}}
-test subst-8.7 {return in a subst, parse error} {
+test subst-8.7 {return in a subst, parse error} -body {
subst {foo [return {x} ; set a {}" ; stuff] bar}
-} {foo xset a {}" ; stuff] bar}
-test subst-8.8 {return in a subst, parse error} {
+} -returnCodes error -result {extra characters after close-brace}
+test subst-8.8 {return in a subst, parse error} -body {
subst {foo [return {x} ; set bar baz ; set a {}" ; stuff] bar}
-} {foo xset bar baz ; set a {}" ; stuff] bar}
+} -returnCodes error -result {extra characters after close-brace}
test subst-8.9 {return in a variable subst} {
subst {foo $var([return {x}]) bar}
} {foo x bar}
@@ -208,12 +208,12 @@ test subst-11.2 {continue in a subst} {
test subst-11.3 {continue in a subst} {
subst {foo [if 1 { continue; bogus code}] bar}
} {foo bar}
-test subst-11.4 {continue in a subst, parse error} {
+test subst-11.4 {continue in a subst, parse error} -body {
subst {foo [continue ; set a {}{} ; stuff] bar}
-} {foo set a {}{} ; stuff] bar}
-test subst-11.5 {continue in a subst, parse error} {
+} -returnCodes error -result {extra characters after close-brace}
+test subst-11.5 {continue in a subst, parse error} -body {
subst {foo [continue ;set bar baz ;set a {}{} ; stuff] bar}
-} {foo set bar baz ;set a {}{} ; stuff] bar}
+} -returnCodes error -result {extra characters after close-brace}
test subst-11.6 {continue in a variable subst} {
subst {foo $var([continue]) bar}
} {foo bar}
@@ -235,24 +235,24 @@ test subst-12.2 {nasty case, Bug 1036649} {
test subst-12.3 {nasty case, Bug 1036649} {
set x 0
for {set i 0} {$i < 10} {incr i} {
- set res [list [catch {subst "\[incr x;"} msg] $msg]
- if {$msg ne "missing close-bracket"} break
+ set res [list [catch {subst "\[incr x;"} msg] $msg]
+ if {$msg ne "missing close-bracket"} break
}
list $res $x
} {{1 {missing close-bracket}} 10}
test subst-12.4 {nasty case, Bug 1036649} {
set x 0
for {set i 0} {$i < 10} {incr i} {
- set res [list [catch {subst "\[incr x; "} msg] $msg]
- if {$msg ne "missing close-bracket"} break
+ set res [list [catch {subst "\[incr x; "} msg] $msg]
+ if {$msg ne "missing close-bracket"} break
}
list $res $x
} {{1 {missing close-bracket}} 10}
test subst-12.5 {nasty case, Bug 1036649} {
set x 0
for {set i 0} {$i < 10} {incr i} {
- set res [list [catch {subst "\[incr x"} msg] $msg]
- if {$msg ne "missing close-bracket"} break
+ set res [list [catch {subst "\[incr x"} msg] $msg]
+ if {$msg ne "missing close-bracket"} break
}
list $res $x
} {{1 {missing close-bracket}} 0}