From 613d3aaac8fffe35fccf988a875051486deb383d Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Sat, 21 Mar 2009 01:23:38 +0000 Subject: * tests/tailcall.test: slightly improved tests --- ChangeLog | 4 ++++ tests/tailcall.test | 32 +++++++++++++++++++++++++++----- 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 + + * tests/tailcall.test: slightly improved tests + 2009-03-20 Don Porter * 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 -- cgit v0.12