summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-30 22:26:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-30 22:26:43 (GMT)
commit26e2008515075fa191d71fa2c8d21bd8032aaf75 (patch)
tree855cb8a0b5062bf4f178a9eba1c51d73da9e0609 /tests
parent7c7c6aa17bf0f27a8d5890a53d75e74830212d02 (diff)
downloadtcl-26e2008515075fa191d71fa2c8d21bd8032aaf75.zip
tcl-26e2008515075fa191d71fa2c8d21bd8032aaf75.tar.gz
tcl-26e2008515075fa191d71fa2c8d21bd8032aaf75.tar.bz2
[Bug 2923613]: Make the safer [source] handle a [return] at the end of the
file correctly.
Diffstat (limited to 'tests')
-rw-r--r--tests/safe.test13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/safe.test b/tests/safe.test
index 223559a..db8952b 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: safe.test,v 1.31 2009/12/29 14:55:42 dkf Exp $
+# RCS: @(#) $Id: safe.test,v 1.32 2009/12/30 22:26:43 dkf Exp $
package require Tcl 8.5
@@ -320,6 +320,17 @@ test safe-8.8 {safe source forbids -rsrc} -setup {
} -returnCodes error -cleanup {
safe::interpDelete $i
} -result {wrong # args: should be "source ?-encoding E? fileName"}
+test safe-8.9 {safe source and return} -setup {
+ set returnScript [makeFile {return "ok"} return.tcl]
+ catch {safe::interpDelete $i}
+} -body {
+ safe::interpCreate $i
+ set token [safe::interpAddToAccessPath $i [file dirname $returnScript]]
+ $i eval [list source $token/[file tail $returnScript]]
+} -cleanup {
+ catch {safe::interpDelete $i}
+ removeFile $returnScript
+} -result ok
test safe-9.1 {safe interps' deleteHook} -setup {
set i "a"