summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-03-21 01:23:38 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-03-21 01:23:38 (GMT)
commit613d3aaac8fffe35fccf988a875051486deb383d (patch)
tree049ab9b0054761e534c0b975fe50722f912a4458
parentdfe41925f76a800c5abaaffdbe7b7676fca1430c (diff)
downloadtcl-613d3aaac8fffe35fccf988a875051486deb383d.zip
tcl-613d3aaac8fffe35fccf988a875051486deb383d.tar.gz
tcl-613d3aaac8fffe35fccf988a875051486deb383d.tar.bz2
* tests/tailcall.test: slightly improved tests
-rw-r--r--ChangeLog4
-rw-r--r--tests/tailcall.test32
2 files changed, 31 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 12d4812..214fc02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-03-20 Miguel Sofer <msofer@users.sf.net>
+
+ * tests/tailcall.test: slightly improved tests
+
2009-03-20 Don Porter <dgp@users.sourceforge.net>
* generic/tclExecute.c (INST_CONCAT1): Panic when appends overflow
diff --git a/tests/tailcall.test b/tests/tailcall.test
index a3cf88e..0c91488 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.1 2009/03/19 23:31:37 msofer Exp $
+# RCS: @(#) $Id: tailcall.test,v 1.2 2009/03/21 01:23:38 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -221,7 +221,7 @@ test tailcall-9 {tailcall factorial} -setup {
rename fact {}
} -result {1 120 3628800 1307674368000}
-test tailcall-10 {tailcall and eval} -constraints {knownBug} -setup {
+test tailcall-10a {tailcall and eval} -constraints {knownBug} -setup {
proc a {} {
eval [list tailcall lappend ::x 2]
set ::x 1
@@ -230,9 +230,20 @@ test tailcall-10 {tailcall and eval} -constraints {knownBug} -setup {
list [a] $::x
} -cleanup {
unset -nocomplain ::x
-} -result {1 2}
+} -result {{1 2} {1 2}}
-test tailcall-11 {tailcall and uplevel} -constraints {knownBug} -setup {
+test tailcall-10b {tailcall and eval} -setup {
+ proc a {} {
+ eval {tailcall lappend ::x 2}
+ set ::x 1
+ }
+} -body {
+ list [a] $::x
+} -cleanup {
+ unset -nocomplain ::x
+} -result {{1 2} {1 2}}
+
+test tailcall-11a {tailcall and uplevel} -setup {
proc a {} {
uplevel 1 [list tailcall set ::x 2]
set ::x 1
@@ -241,7 +252,18 @@ test tailcall-11 {tailcall and uplevel} -constraints {knownBug} -setup {
list [a] $::x
} -cleanup {
unset -nocomplain ::x
-} -result {1 2}
+} -match glob -result *tailcall* -returnCodes error
+
+test tailcall-11b {tailcall and uplevel} -setup {
+ proc a {} {
+ uplevel 1 {tailcall set ::x 2}
+ set ::x 1
+ }
+} -body {
+ list [a] $::x
+} -cleanup {
+ unset -nocomplain ::x
+} -match glob -result *tailcall* -returnCodes error
# cleanup
::tcltest::cleanupTests