summaryrefslogtreecommitdiffstats
path: root/tests/switch.test
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2009-07-14 16:52:28 (GMT)
committerKevin B Kenny <kennykb@acm.org>2009-07-14 16:52:28 (GMT)
commit67e100ed95642d0ec30b5718d5c2eb66535c3cbe (patch)
tree3f792ab808ad24f569fa00894c9bab62e4972d9f /tests/switch.test
parent08604cad04da0d67c84406f99bda814f6a416386 (diff)
downloadtcl-67e100ed95642d0ec30b5718d5c2eb66535c3cbe.zip
tcl-67e100ed95642d0ec30b5718d5c2eb66535c3cbe.tar.gz
tcl-67e100ed95642d0ec30b5718d5c2eb66535c3cbe.tar.bz2
* generic/tclInt.h (TclNRSwitchObjCmd):
* generic/tclBasic.c (builtInCmds): * generic/tclCmdMZ.c (Tcl_SwitchObjCmd): * tests/switch.test (switch-15.1): Make non-bytecoded [switch] command aware of NRE. [Bug 2821401]
Diffstat (limited to 'tests/switch.test')
-rw-r--r--tests/switch.test18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/switch.test b/tests/switch.test
index 2652a70..738565f 100644
--- a/tests/switch.test
+++ b/tests/switch.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: switch.test,v 1.24 2009/06/24 15:17:41 dgp Exp $
+# RCS: @(#) $Id: switch.test,v 1.25 2009/07/14 16:52:28 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -738,6 +738,22 @@ test switch-14.16 {switch -regexp compilation} {
}}
} no
+test switch-15.1 {coroutine safety of non-bytecoded switch} {*}{
+ -body {
+ proc coro {} {
+ switch -glob a {
+ a {yield ok1}
+ }
+ return ok2
+ }
+ list [coroutine c coro] [c]
+ }
+ -result {ok1 ok2}
+ -cleanup {
+ rename coro {}
+ }
+}
+
# cleanup
catch {rename foo {}}
::tcltest::cleanupTests