diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-05-26 12:51:55 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-05-26 12:51:55 (GMT) |
commit | 8d944280e1616ab92d470c999c5c1b98bf97908d (patch) | |
tree | 194aa0a9f959a329e2cbdf61625b09a89f49716d | |
parent | b317e4d6a30ce58b28482a6b884f3aed5a3f05f7 (diff) | |
download | tcl-8d944280e1616ab92d470c999c5c1b98bf97908d.zip tcl-8d944280e1616ab92d470c999c5c1b98bf97908d.tar.gz tcl-8d944280e1616ab92d470c999c5c1b98bf97908d.tar.bz2 |
Track the remnants of [Bug 2913625] as knownBug tests. :-(
-rw-r--r-- | tests/safe.test | 46 |
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 |