diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2010-08-11 23:38:56 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2010-08-11 23:38:56 (GMT) |
commit | 893040ded5d960a9e7b736019853d5b2a02b02df (patch) | |
tree | 0f21f01993045e024e6705905062732e9cfe223d | |
parent | d4439781ca7806d539585ab1e454657ed8e2bda7 (diff) | |
download | tcl-893040ded5d960a9e7b736019853d5b2a02b02df.zip tcl-893040ded5d960a9e7b736019853d5b2a02b02df.tar.gz tcl-893040ded5d960a9e7b736019853d5b2a02b02df.tar.bz2 |
added test for yieldTo
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | tests/coroutine.test | 16 |
2 files changed, 19 insertions, 3 deletions
@@ -1,7 +1,9 @@ 2010-08-11 Miguel Sofer <msofer@users.sf.net> - * 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 <jeffh@ActiveState.com> * 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 |