summaryrefslogtreecommitdiffstats
path: root/tests/source.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/source.test')
-rw-r--r--tests/source.test20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/source.test b/tests/source.test
index dc3c2d8..6ee2198 100644
--- a/tests/source.test
+++ b/tests/source.test
@@ -19,7 +19,7 @@ if {[catch {package require tcltest 2.1}]} {
namespace eval ::tcl::test::source {
namespace import ::tcltest::*
-
+
test source-1.1 {source command} -setup {
set x "old x value"
set y "old y value"
@@ -187,7 +187,7 @@ test source-3.5 {return with special code etc.} -setup {
invoked from within
"source $sourcefile"} {a b c}}
-test source-4.1 {continuation line parsing} -setup {
+test source-4.1 {continuation line parsing} -constraints knownBug -setup {
set sourcefile [makeFile [string map {CL \\\n} {
format %s "[dict get [info frame 0] type]:CL[dict get [info frame 0] line]CL[dict get [info frame 0] line]CL[dict get [info frame 0] line]"
}] source.file]
@@ -290,7 +290,23 @@ test source-7.6 {source -encoding: mismatch encoding error} -setup {
removeFile source.file
} -returnCodes error -match glob -result {invalid command name*}
+test source-8.1 {source and coroutine/yield} -setup {
+ set sourcefile [makeFile {} source.file]
+ file delete $sourcefile
+} -body {
+ makeFile {yield 1; yield 2; return 3;} $sourcefile
+ coroutine coro apply {f {yield;source $f}} $sourcefile
+ list [coro] [coro] [coro] [info exist coro]
+} -cleanup {
+ catch {rename coro {}}
+ removeFile source.file
+} -result {1 2 3 0}
+
cleanupTests
}
namespace delete ::tcl::test::source
return
+
+# Local Variables:
+# mode: tcl
+# End: