summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-12-05 21:30:05 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-12-05 21:30:05 (GMT)
commit90bd6886192a7f8aba161a9c45eb000b9e59e69c (patch)
tree364580df13345c4b42788e63d9c681325eb910a9 /tests
parent2aa99d284d6f4194676a3e2f5aac6ad2197a7714 (diff)
downloadtcl-90bd6886192a7f8aba161a9c45eb000b9e59e69c.zip
tcl-90bd6886192a7f8aba161a9c45eb000b9e59e69c.tar.gz
tcl-90bd6886192a7f8aba161a9c45eb000b9e59e69c.tar.bz2
* generic/tclBasic.c: Fixed things so that you can tailcall
* generic/tclNamesp.c: properly out of a coroutine. * tests/tailcall.test: * generic/tclInterp.c: Fixed tailcalls for same-interp aliases (no test)
Diffstat (limited to 'tests')
-rw-r--r--tests/tailcall.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/tailcall.test b/tests/tailcall.test
index 335492a..5918bfe 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.9 2009/06/25 19:24:16 dgp Exp $
+# RCS: @(#) $Id: tailcall.test,v 1.10 2009/12/05 21:30:06 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -560,6 +560,23 @@ test tailcall-12.3b {[Bug 2695587]} -setup {
rename a {}
} -result {1 {Tailcall called from within a catch environment}}
+test tailcall-13.1 {tailcall and coroutine} -setup {
+ set lambda {i {
+ if {$i == 0} {
+ depthDiff
+ }
+ if {[incr i] > 10} {
+ return [depthDiff]
+ }
+ tailcall coroutine foo ::apply $::lambda $i
+ }}
+} -body {
+ coroutine moo ::apply $::lambda 0
+} -cleanup {
+ unset lambda
+} -result {0 0 0 0 0 0}
+
+
if {[testConstraint testnrelevels]} {
namespace forget testnre::*