summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/subst.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/subst.test b/tests/subst.test
index f9e3e78..179e086 100644
--- a/tests/subst.test
+++ b/tests/subst.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: subst.test,v 1.10 2002/02/25 23:17:21 msofer Exp $
+# RCS: @(#) $Id: subst.test,v 1.11 2002/04/05 19:26:35 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -150,6 +150,9 @@ test subst-8.7 {return in a subst, parse error} {
test subst-8.8 {return in a subst, parse error} {
subst {foo [return {x} ; set bar baz ; set a {}" ; stuff] bar}
} {foo xset bar baz ; set a {}" ; stuff] bar}
+test subst-8.9 {return in a variable subst} {
+ subst {foo $var([return {x}]) bar}
+} {foo x bar}
test subst-9.1 {error in a subst} {
list [catch {subst {[error foo; bogus code]bar}} msg] $msg
@@ -157,6 +160,9 @@ test subst-9.1 {error in a subst} {
test subst-9.2 {error in a subst} {
list [catch {subst {[if 1 { error foo; bogus code}]bar}} msg] $msg
} {1 foo}
+test subst-9.3 {error in a variable subst} {
+ list [catch {subst {foo $var([error foo]) bar}} msg] $msg
+} {1 foo}
test subst-10.1 {break in a subst} {
subst {foo [break; bogus code] bar}
@@ -173,6 +179,9 @@ test subst-10.4 {break in a subst, parse error} {
test subst-10.5 {break in a subst, parse error} {
subst {foo [break ;set bar baz ;set a {}{} ; stuff] bar}
} {foo }
+test subst-10.6 {break in a variable subst} {
+ subst {foo $var([break]) bar}
+} {foo }
test subst-11.1 {continue in a subst} {
subst {foo [continue; bogus code] bar}
@@ -189,6 +198,9 @@ test subst-11.4 {continue in a subst, parse error} {
test subst-11.5 {continue in a subst, parse error} {
subst {foo [continue ;set bar baz ;set a {}{} ; stuff] bar}
} {foo set bar baz ;set a {}{} ; stuff] bar}
+test subst-11.6 {continue in a variable subst} {
+ subst {foo $var([continue]) bar}
+} {foo bar}
# cleanup
::tcltest::cleanupTests