From 893040ded5d960a9e7b736019853d5b2a02b02df Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Wed, 11 Aug 2010 23:38:56 +0000 Subject: added test for yieldTo --- ChangeLog | 6 ++++-- tests/coroutine.test | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cc7450..5947533 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ 2010-08-11 Miguel Sofer - * generic/tclBasic.c (TclNRYieldToObjCmd): fixed bad copypasta - snafu. Thanks to Andy Goth for finding the bug. + * generic/tclBasic.c (TclNRYieldToObjCmd): + * tests/coroutine.test: fixed bad copypasta snafu. + Thanks to Andy Goth for finding the bug. + 2010-08-10 Jeff Hobbs * generic/tclUtil.c (TclByteArrayMatch): patterns may not be diff --git a/tests/coroutine.test b/tests/coroutine.test index d563aa4..d7b30bc 100644 --- a/tests/coroutine.test +++ b/tests/coroutine.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: coroutine.test,v 1.13 2010/04/30 12:38:46 dkf Exp $ +# RCS: @(#) $Id: coroutine.test,v 1.14 2010/08/11 23:38:57 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -550,6 +550,20 @@ test coroutine-6.4 {unsupported: multi-argument yield} -body { } -cleanup { rename corobody {} } -result {x {y z 2} \{p {\{q r 2} {} 0 {} ok {}} + +test coroutine-7.1 {yieldTo} -body { + coroutine c apply {{} { + yield + tcl::unsupported::yieldTo return -level 0 -code 1 quux + return quuy + }} + set res [list [catch c msg] $msg] + lappend res [catch c msg] $msg + lappend res [catch c msg] $msg +} -cleanup { + unset res +} -result [list 1 quux 0 quuy 1 {invalid command name "c"}] + # cleanup unset lambda -- cgit v0.12