summaryrefslogtreecommitdiffstats
path: root/tests/tailcall.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-03-21 03:43:53 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-03-21 03:43:53 (GMT)
commit4ff9be7699dc5b15cd2272692d62e89432866d64 (patch)
treee8eb405ce3cc2c78da76dcf2b42729c819463893 /tests/tailcall.test
parentb694e6b4fab8a3ac24df527d0ce9d9089c215316 (diff)
downloadtcl-4ff9be7699dc5b15cd2272692d62e89432866d64.zip
tcl-4ff9be7699dc5b15cd2272692d62e89432866d64.tar.gz
tcl-4ff9be7699dc5b15cd2272692d62e89432866d64.tar.bz2
* generic/tclExecute.c: fix both test and code for tailcall
* tests/tailcall.test: from within a compiled [eval] body.
Diffstat (limited to 'tests/tailcall.test')
-rw-r--r--tests/tailcall.test8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/tailcall.test b/tests/tailcall.test
index 0c91488..fb6d662 100644
--- a/tests/tailcall.test
+++ b/tests/tailcall.test
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tailcall.test,v 1.2 2009/03/21 01:23:38 msofer Exp $
+# RCS: @(#) $Id: tailcall.test,v 1.3 2009/03/21 03:43:53 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -222,6 +222,7 @@ test tailcall-9 {tailcall factorial} -setup {
} -result {1 120 3628800 1307674368000}
test tailcall-10a {tailcall and eval} -constraints {knownBug} -setup {
+ set ::x 0
proc a {} {
eval [list tailcall lappend ::x 2]
set ::x 1
@@ -230,9 +231,10 @@ test tailcall-10a {tailcall and eval} -constraints {knownBug} -setup {
list [a] $::x
} -cleanup {
unset -nocomplain ::x
-} -result {{1 2} {1 2}}
+} -result {{0 2} {0 2}}
test tailcall-10b {tailcall and eval} -setup {
+ set ::x 0
proc a {} {
eval {tailcall lappend ::x 2}
set ::x 1
@@ -241,7 +243,7 @@ test tailcall-10b {tailcall and eval} -setup {
list [a] $::x
} -cleanup {
unset -nocomplain ::x
-} -result {{1 2} {1 2}}
+} -result {{0 2} {0 2}}
test tailcall-11a {tailcall and uplevel} -setup {
proc a {} {