summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-27 10:13:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-03-27 10:13:07 (GMT)
commitea1476c544dc734fc01fa6896ba5942948913eee (patch)
tree4f362ebcdf26c7826359ad5b3b40da29e97378dc /tests
parent7f649ad0bb5cffdd357e0d3e9f0d6c15d69e6722 (diff)
parent1abdef6a10523363f5da7923ff02d13f5bfcd92e (diff)
downloadtcl-bug_3562640.zip
tcl-bug_3562640.tar.gz
tcl-bug_3562640.tar.bz2
merge core-8-4-branchbug_3562640
Diffstat (limited to 'tests')
-rw-r--r--tests/cmdAH.test13
-rw-r--r--tests/fCmd.test22
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/cmdAH.test b/tests/cmdAH.test
index 28e396f..311d3c9 100644
--- a/tests/cmdAH.test
+++ b/tests/cmdAH.test
@@ -909,6 +909,19 @@ test cmdAH-19.11 {Tcl_FileObjCmd: exists} {unixOnly notRoot} {
removeDirectory /tmp/tcl.foo.dir
set result
} 0
+test cmdAH-19.12 {Bug 3608360: [file exists] mustn't do globbing} -setup {
+ set newdirfile [makeDirectory newdir.file]
+ set cwd [pwd]
+ cd $newdirfile
+ # Content of file is totally unimportant; name is *not*
+ set innocentBystander [makeFile "abc" [file join $newdirfile foo.bar]]
+} -body {
+ list [file exists foo.bar] [file exists *.bar]
+} -cleanup {
+ cd $cwd
+ removeFile $innocentBystander
+ removeDirectory $newdirfile
+} -result {1 0}
# Stat related commands
diff --git a/tests/fCmd.test b/tests/fCmd.test
index c5ee676..6b054f7 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.test
@@ -2407,6 +2407,28 @@ cd [temporaryDirectory]
file delete -force abc.link
cd [workingDirectory]
+test fCmd-30.1 {file writable on 'My Documents'} -setup {
+ # Get the localized version of the folder name by looking in the registry.
+ set mydocsname [registry get {HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders} Personal]
+} -constraints {win reg} -body {
+ file writable $mydocsname
+} -result 1
+test fCmd-30.2 {file readable on 'NTUSER.DAT'} -constraints {win} -body {
+ expr {[info exists env(USERPROFILE)]
+ && [file exists $env(USERPROFILE)/NTUSER.DAT]
+ && [file readable $env(USERPROFILE)/NTUSER.DAT]}
+} -result {1}
+test fCmd-30.3 {file readable on 'pagefile.sys'} -constraints {win} -body {
+ set r {}
+ if {[info exists env(SystemDrive)]} {
+ set path $env(SystemDrive)/pagefile.sys
+ lappend r exists [file exists $path]
+ lappend r readable [file readable $path]
+ lappend r stat [catch {file stat $path a} e] $e
+ }
+ return $r
+} -result {exists 1 readable 0 stat 0 {}}
+
removeFile abc2.file
removeFile abc.file
removeDirectory abc2.dir