summaryrefslogtreecommitdiffstats
path: root/tests/tailcall.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2010-08-18 15:44:09 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2010-08-18 15:44:09 (GMT)
commit096e06e4b8606abecd8fe11c9919df4f35cf4d52 (patch)
treef997dd6e04e669fc5c94627f3ab580c39c22fc71 /tests/tailcall.test
parent8288b47f5e7647e90d8499bf5e45099b1651aa62 (diff)
downloadtcl-096e06e4b8606abecd8fe11c9919df4f35cf4d52.zip
tcl-096e06e4b8606abecd8fe11c9919df4f35cf4d52.tar.gz
tcl-096e06e4b8606abecd8fe11c9919df4f35cf4d52.tar.bz2
* generic/tclBasic.c: Redesign of [tailcall] to
* generic/tclCmdAH.c: (a) fix #3047235 * generic/tclCompile.h: (b) enable fix for #3046594 * generic/tclExecute.c: (c) enable recursive tailcalls * generic/tclInt.h: * generic/tclNamesp.c: * tests/tailcall.test:
Diffstat (limited to 'tests/tailcall.test')
-rw-r--r--tests/tailcall.test22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/tailcall.test b/tests/tailcall.test
index b8a3210..efb5fa4 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.12 2010/01/22 10:22:51 dkf Exp $
+# RCS: @(#) $Id: tailcall.test,v 1.13 2010/08/18 15:44:13 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -323,7 +323,7 @@ test tailcall-8 {tailcall tailcall} -setup {
namespace eval ::foo c
} -cleanup {
namespace delete ::foo
-} -match glob -result *tailcall* -returnCodes error
+} -result cbac
test tailcall-9 {tailcall factorial} -setup {
proc fact {n {b 1}} {
@@ -557,6 +557,18 @@ test tailcall-12.3b {[Bug 2695587]} {
}}
} {1 {tailcall called from within a catch environment} {TCL TAILCALL ILLEGAL}}
+test tailcall-12.3c {[Bug 3046594]} {
+ apply {{} {
+ list [[subst catch] {tailcall foo} msg opt] $msg [errorcode $opt]
+ }}
+} {1 {tailcall called from within a catch environment} {TCL TAILCALL ILLEGAL}}
+
+test tailcall-12.3d {[Bug 3046594]} {
+ apply {{} {
+ list [[subst catch] [list tailcall foo] msg opt] $msg [errorcode $opt]
+ }}
+} {1 {tailcall called from within a catch environment} {TCL TAILCALL ILLEGAL}}
+
test tailcall-13.1 {tailcall and coroutine} -setup {
set lambda {i {
if {$i == 1} {
@@ -573,17 +585,17 @@ test tailcall-13.1 {tailcall and coroutine} -setup {
unset lambda
} -result {0 0 0 0 0 0}
-test tailcall-14.1 {directly tailcalling the tailcall command is an error} {
+test tailcall-14.1 {directly tailcalling the tailcall command is ok} {
list [catch {
apply {{} {
apply {{} {
- tailcall tailcall subst a
+ tailcall tailcall subst ok
subst b
}}
subst c
}}
} msg opt] $msg [errorcode $opt]
-} {1 {tailcall cannot be invoked recursively} {TCL TAILCALL REENTRY}}
+} {0 ok NONE}
test tailcall-14.2 {indirectly tailcalling the tailcall command is ok} {
list [catch {
apply {{} {