summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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 {{} {