summaryrefslogtreecommitdiffstats
path: root/tests/parse.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-03-18 16:33:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-03-18 16:33:32 (GMT)
commit38aa6b01bae64c7dfadc6191237627723343a0a3 (patch)
tree7baf6484b4775badabfc961d085c528deeecf945 /tests/parse.test
parent5a484df86936621e5bf60c2a78ab5832ed886485 (diff)
downloadtcl-38aa6b01bae64c7dfadc6191237627723343a0a3.zip
tcl-38aa6b01bae64c7dfadc6191237627723343a0a3.tar.gz
tcl-38aa6b01bae64c7dfadc6191237627723343a0a3.tar.bz2
* generic/tclBasic.c (Tcl_EvalEx,TclEvalTokensStandard):
* generic/tclCmdMZ.c (Tcl_SubstObj): * tests/basic.test (basic-46.4): Restored recursion limit * tests/parse.test (parse-19.*): testing in nested command substitutions within direct script evaluation (Tcl_EvalEx) that got lost in the parser reforms of Tcl 8.1. Added tests for correct behavior. [Bug 1115904]
Diffstat (limited to 'tests/parse.test')
-rw-r--r--tests/parse.test48
1 files changed, 47 insertions, 1 deletions
diff --git a/tests/parse.test b/tests/parse.test
index 8007fc2..124ab0f 100644
--- a/tests/parse.test
+++ b/tests/parse.test
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: parse.test,v 1.11.2.1 2003/03/27 13:49:22 dkf Exp $
+# RCS: @(#) $Id: parse.test,v 1.11.2.2 2005/03/18 16:33:43 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -744,6 +744,52 @@ test parse-17.1 {Correct return codes from errors during substitution} {
catch {eval {w[continue]}}
} 4
+test parse-19.1 {Bug 1115904: recursion limit in Tcl_EvalEx} -constraints {
+ testevalex
+} -setup {
+ interp create i
+ load {} Tcltest i
+ i eval {proc {} args {}}
+ interp recursionlimit i 3
+} -body {
+ i eval {testevalex {[]}}
+} -cleanup {
+ interp delete i
+}
+
+test parse-19.2 {Bug 1115904: recursion limit in Tcl_EvalEx} -constraints {
+ testevalex
+} -setup {
+ interp create i
+ load {} Tcltest i
+ i eval {proc {} args {}}
+ interp recursionlimit i 3
+} -body {
+ i eval {testevalex {[[]]}}
+} -cleanup {
+ interp delete i
+} -returnCodes error -match glob -result {too many nested*}
+
+test parse-19.3 {Bug 1115904: recursion limit in Tcl_EvalEx} -setup {
+ interp create i
+ i eval {proc {} args {}}
+ interp recursionlimit i 3
+} -body {
+ i eval {subst {[]}}
+} -cleanup {
+ interp delete i
+}
+
+test parse-19.4 {Bug 1115904: recursion limit in Tcl_EvalEx} -setup {
+ interp create i
+ i eval {proc {} args {}}
+ interp recursionlimit i 3
+} -body {
+ i eval {subst {[[]]}}
+} -cleanup {
+ interp delete i
+} -returnCodes error -match glob -result {too many nested*}
+
# cleanup
catch {unset a}
::tcltest::cleanupTests