From 529b3009a5528d1afe122d5fae4b5c739b4618fb Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 5 Jan 2009 11:27:41 +0000 Subject: Added a test, correct a dumb blunder. --- generic/tclCmdMZ.c | 4 ++-- tests/source.test | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 6025f90..feb87cd 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.173 2009/01/05 09:48:11 dkf Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.174 2009/01/05 11:27:41 dkf Exp $ */ #include "tclInt.h" @@ -971,7 +971,7 @@ TclNRSourceObjCmd( encodingName = TclGetString(objv[2]); } - return Tcl_FSEvalFileEx(interp, fileName, encodingName); + return TclNREvalFile(interp, fileName, encodingName); } /* diff --git a/tests/source.test b/tests/source.test index 29d3f2f..f358042 100644 --- a/tests/source.test +++ b/tests/source.test @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: source.test,v 1.13 2006/03/21 11:12:29 dkf Exp $ +# RCS: @(#) $Id: source.test,v 1.14 2009/01/05 11:27:41 dkf Exp $ if {[catch {package require tcltest 2.1}]} { puts stderr "Skipping tests in [info script]. tcltest 2.1 required." @@ -21,7 +21,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" @@ -269,7 +269,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: \ No newline at end of file -- cgit v0.12