summaryrefslogtreecommitdiffstats
path: root/tests/safe.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-30 22:20:57 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-30 22:20:57 (GMT)
commit0b28413e2a45ca7e7b0fc35a015b7ef8af931826 (patch)
treec570d2f38edafbc870de694b2fb3864c85ac8a10 /tests/safe.test
parente0a526e0845027a3332645c718bb528d55bba601 (diff)
downloadtcl-0b28413e2a45ca7e7b0fc35a015b7ef8af931826.zip
tcl-0b28413e2a45ca7e7b0fc35a015b7ef8af931826.tar.gz
tcl-0b28413e2a45ca7e7b0fc35a015b7ef8af931826.tar.bz2
[Bug 2923613]: Make the safer [source] handle a [return] at the end of the file
correctly.
Diffstat (limited to 'tests/safe.test')
-rw-r--r--tests/safe.test13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/safe.test b/tests/safe.test
index e4e3596..aedc7de 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.22.4.6 2009/12/29 13:13:18 dkf Exp $
+# RCS: @(#) $Id: safe.test,v 1.22.4.7 2009/12/30 22:20:57 dkf Exp $
package require Tcl 8.5
@@ -300,6 +300,17 @@ test safe-8.8 {safe source forbids -rsrc} {
$msg \
[safe::interpDelete $i] ;
} {1 {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} {
set i "a";