summaryrefslogtreecommitdiffstats
path: root/tests/parse.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-03-18 15:50:56 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-03-18 15:50:56 (GMT)
commit1602b42886546fdee649c4be434cb8520e255248 (patch)
tree1b3e83defa340cf74ce336ffb668012adebdcc4c /tests/parse.test
parentf7bd42abc0c6952dae468911161f6dd0dc01f913 (diff)
downloadtcl-1602b42886546fdee649c4be434cb8520e255248.zip
tcl-1602b42886546fdee649c4be434cb8520e255248.tar.gz
tcl-1602b42886546fdee649c4be434cb8520e255248.tar.bz2
* generic/tclBasic.c (Tcl_EvalEx): Restored recursion limit
* generic/tclParse.c (TclSubstTokens): testing in nested command * tests/basic.test (basic-46.4): substitutions within direct * tests/parse.test (parse-19.*): 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 619cfdd..192e435 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.19 2004/10/01 03:10:36 dgp Exp $
+# RCS: @(#) $Id: parse.test,v 1.20 2005/03/18 15:51:01 dgp Exp $
if {[catch {package require tcltest 2.0.2}]} {
puts stderr "Skipping tests in [info script]. tcltest 2.0.2 required."
@@ -944,6 +944,52 @@ test parse-18.30 {Tcl_SubstObj, side effects} {
set a
} 1
+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*}
+
cleanupTests
}