summaryrefslogtreecommitdiffstats
path: root/tests/safe.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-05-26 12:51:55 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-05-26 12:51:55 (GMT)
commite5539135b837450e93c2470e43049bcb08648d97 (patch)
tree194aa0a9f959a329e2cbdf61625b09a89f49716d /tests/safe.test
parent3b7874998c20e5c1a931b1a9c6337f154c65351c (diff)
downloadtcl-e5539135b837450e93c2470e43049bcb08648d97.zip
tcl-e5539135b837450e93c2470e43049bcb08648d97.tar.gz
tcl-e5539135b837450e93c2470e43049bcb08648d97.tar.bz2
Track the remnants of [Bug 2913625] as knownBug tests. :-(
Diffstat (limited to 'tests/safe.test')
-rw-r--r--tests/safe.test46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/safe.test b/tests/safe.test
index 7b83cc6..4bd8509 100644
--- a/tests/safe.test
+++ b/tests/safe.test
@@ -690,6 +690,52 @@ test safe-14.1 {Check that module path is the same as in the master interpreter
} -cleanup {
safe::interpDelete $i
} -result [::tcl::tm::path list]
+
+### ~ should have no special meaning in paths in safe interpreters
+test safe-15.1 {Bug 2913625: defang ~ in paths} -setup {
+ set savedHOME $env(HOME)
+ set env(HOME) /foo/bar
+ set i [safe::interpCreate]
+} -constraints knownBug -body {
+ $i eval {
+ set d [format %c 126]
+ list [file dirname $d] [file tail $d] \
+ [file join [file dirname $d] [file tail $d]]
+ }
+} -cleanup {
+ safe::interpDelete $i
+ set env(HOME) $savedHOME
+} -result {~}
+test safe-15.2 {Bug 2913625: defang ~user in paths} -setup {
+ set i [safe::interpCreate]
+ set user $tcl_platform(user)
+} -constraints knownBug -body {
+ string map [list $user USER] [$i eval \
+ "file join \[file dirname ~$user\] \[file tail ~$user\]"]
+} -cleanup {
+ safe::interpDelete $i
+} -result {~USER}
+test safe-15.3 {Bug 2913625: defang ~ in globs} -setup {
+ set savedHOME $env(HOME)
+ set env(HOME) /
+ set i [safe::interpCreate]
+} -constraints knownBug -body {
+ $i expose glob realglob
+ $i eval {realglob -nocomplain [join {~ / *} ""]}
+} -cleanup {
+ safe::interpDelete $i
+ set env(HOME) $savedHOME
+} -result {~}
+test safe-15.4 {Bug 2913625: defang ~user in globs} -setup {
+ set i [safe::interpCreate]
+ set user $tcl_platform(user)
+} -constraints knownBug -body {
+ $i expose glob realglob
+ string map [list $user USER] [$i eval [list\
+ realglob -directory ~$user *]]
+} -cleanup {
+ safe::interpDelete $i
+} -result {~USER}
set ::auto_path $saveAutoPath
# cleanup