summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2004-01-21 19:59:32 (GMT)
committervincentdarley <vincentdarley@noemail.net>2004-01-21 19:59:32 (GMT)
commit25a16d68f72f2c8425d6f443f9a69e5df6afe44f (patch)
tree0ffe5e984dd325a6bea1e24606e505aa4f37574b /tests
parenta41b4f5072bdca8cf305eb70e821660477b632f0 (diff)
downloadtcl-25a16d68f72f2c8425d6f443f9a69e5df6afe44f.zip
tcl-25a16d68f72f2c8425d6f443f9a69e5df6afe44f.tar.gz
tcl-25a16d68f72f2c8425d6f443f9a69e5df6afe44f.tar.bz2
filesystem optimisation -- Three main issues accomplished: (1) cleaned up variable names in
FossilOrigin-Name: 9cfcca63fb07d8c7d68befc16d84d01790094ac5
Diffstat (limited to 'tests')
-rw-r--r--tests/fCmd.test8
-rw-r--r--tests/fileName.test51
-rw-r--r--tests/fileSystem.test8
-rw-r--r--tests/winFCmd.test4
4 files changed, 48 insertions, 23 deletions
diff --git a/tests/fCmd.test b/tests/fCmd.test
index c0f6948..79050a6 100644
--- a/tests/fCmd.test
+++ b/tests/fCmd.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: fCmd.test,v 1.35 2003/12/17 17:47:28 vincentdarley Exp $
+# RCS: @(#) $Id: fCmd.test,v 1.36 2004/01/21 19:59:33 vincentdarley Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -513,7 +513,7 @@ test fCmd-6.19 {CopyRenameOneFile: errno == EXDEV} {unixOnly notRoot} {
cleanup /tmp
createfile tf1
file rename tf1 /tmp
- glob tf* /tmp/tf1
+ glob -nocomplain tf* /tmp/tf1
} {/tmp/tf1}
test fCmd-6.20 {CopyRenameOneFile: errno == EXDEV} {pcOnly} {
catch {file delete -force c:/tcl8975@ d:/tcl8975@}
@@ -532,14 +532,14 @@ test fCmd-6.21 {CopyRenameOneFile: copy/rename: S_ISDIR(source)} \
cleanup /tmp
file mkdir td1
file rename td1 /tmp
- glob td* /tmp/td*
+ glob -nocomplain td* /tmp/td*
} {/tmp/td1}
test fCmd-6.22 {CopyRenameOneFile: copy/rename: !S_ISDIR(source)} \
{unixOnly notRoot} {
cleanup /tmp
createfile tf1
file rename tf1 /tmp
- glob tf* /tmp/tf*
+ glob -nocomplain tf* /tmp/tf*
} {/tmp/tf1}
test fCmd-6.23 {CopyRenameOneFile: TclpCopyDirectory failed} \
{unixOnly notRoot xdev} {
diff --git a/tests/fileName.test b/tests/fileName.test
index 1a636c6..ea9f294 100644
--- a/tests/fileName.test
+++ b/tests/fileName.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: fileName.test,v 1.34 2003/12/12 17:02:51 vincentdarley Exp $
+# RCS: @(#) $Id: fileName.test,v 1.35 2004/01/21 19:59:33 vincentdarley Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -1001,6 +1001,10 @@ test filename-10.3 {Tcl_TranslateFileName} {testsetplatform} {
testsetplatform windows
list [catch {testtranslatefilename {c:/\\foo/}} msg] $msg
} {0 {c:\foo}}
+test filename-10.3.1 {Tcl_TranslateFileName} {testsetplatform} {
+ testsetplatform windows
+ list [catch {testtranslatefilename {c://///}} msg] $msg
+} {0 c:\\}
test filename-10.4 {Tcl_TranslateFileName} {testsetplatform} {
testsetplatform mac
list [catch {testtranslatefilename foo} msg] $msg
@@ -1584,7 +1588,11 @@ test filename-11.45 {Tcl_GlobCmd on root volume} {
set res2 [glob *]
cd $tmpd
}
- expr {$res1 == $res2}
+ set res [expr {$res1 == $res2}]
+ if {!$res} {
+ lappend res $res1 $res2
+ }
+ set res
} {1}
test filename-11.46 {Tcl_GlobCmd} {
list [catch {glob -types abcde -dir foo *} msg] $msg
@@ -1873,7 +1881,7 @@ test filename-15.4.1 {no complain: no errors, good result} {
test filename-15.5 {unix specific globbing} {unixOnly nonPortable} {
glob ~ouster/.csh*
} "/home/ouster/.cshrc"
-catch {close [open globTest/odd\\\[\]*?\{\}name w]}
+catch {close [open globTest/odd\\\[\]*?\{\}name w]}
test filename-15.6 {unix specific globbing} {unixOnly} {
global env
set temp $env(HOME)
@@ -1883,6 +1891,23 @@ test filename-15.6 {unix specific globbing} {unixOnly} {
set result
} [list 0 [list [lindex [glob ~] 0]/globTest/odd\\\[\]*?\{\}name]]
catch {file delete -force globTest/odd\\\[\]*?\{\}name}
+test filename-15.7 {win specific globbing} {winOnly} {
+ if {[string index [glob ~] end] == "/"} {
+ set res "glob ~ is [glob ~] but shouldn't end in a separator"
+ } else {
+ set res "ok"
+ }
+} {ok}
+test filename-15.8 {win and unix specific globbing} {unixOrWin} {
+ global env
+ set temp $env(HOME)
+ catch {close [open $env(HOME)/globTest/anyname w]} err
+ set env(HOME) $env(HOME)/globTest/anyname
+ set result [list [catch {glob ~} msg] $msg]
+ set env(HOME) $temp
+ catch {file delete -force $env(HOME)/globTest/anyname}
+ set result
+} [list 0 [list [lindex [glob ~] 0]/globTest/anyname]]
# The following tests are only valid for Windows systems.
set oldDir [pwd]
@@ -1909,31 +1934,31 @@ test filename-16.2.1 {windows specific globbing} {pcOnly} {
set res
} {0 c:}
test filename-16.3 {windows specific globbing} {pcOnly} {
- glob c:\\\\
+ glob -nocomplain c:\\\\
} c:/
test filename-16.4 {windows specific globbing} {pcOnly} {
- glob c:/
+ glob -nocomplain c:/
} c:/
test filename-16.5 {windows specific globbing} {pcOnly} {
- glob c:*bTest
+ glob -nocomplain c:*bTest
} c:globTest
test filename-16.6 {windows specific globbing} {pcOnly} {
- glob c:\\\\*bTest
+ glob -nocomplain c:\\\\*bTest
} c:/globTest
test filename-16.7 {windows specific globbing} {pcOnly} {
- glob c:/*bTest
+ glob -nocomplain c:/*bTest
} c:/globTest
test filename-16.8 {windows specific globbing} {pcOnly} {
- lsort [glob c:globTest/*.bat]
+ lsort [glob -nocomplain c:globTest/*.bat]
} {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat}
test filename-16.9 {windows specific globbing} {pcOnly} {
- lsort [glob c:/globTest/*.bat]
+ lsort [glob -nocomplain c:/globTest/*.bat]
} {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat}
test filename-16.10 {windows specific globbing} {pcOnly} {
- lsort [glob c:globTest\\\\*.bat]
+ lsort [glob -nocomplain c:globTest\\\\*.bat]
} {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat}
test filename-16.11 {windows specific globbing} {pcOnly} {
- lsort [glob c:\\\\globTest\\\\*.bat]
+ lsort [glob -nocomplain c:\\\\globTest\\\\*.bat]
} {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat}
# some tests require a shared C drive
@@ -1961,7 +1986,7 @@ test filename-16.15 {windows specific globbing} {pcOnly} {
glob ..
} {..}
test filename-16.16 {windows specific globbing} {pcOnly} {
- file tail [lindex [glob "[lindex [glob -types d -dir C:/ *] 0]/.."] 0]
+ file tail [lindex [glob -nocomplain "[lindex [glob -types d -dir C:/ *] 0]/.."] 0]
} {..}
test filename-17.1 {windows specific special files} {testsetplatform} {
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index 91a468f..69db7f6 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -358,7 +358,7 @@ test filesystem-4.0 {testfilesystem} {
testfilesystem 0
set filesystemReport
}
- -result {* {access foo}}
+ -result {*{access foo}}
}
test filesystem-4.1 {testfilesystem} {
@@ -371,7 +371,7 @@ test filesystem-4.1 {testfilesystem} {
testfilesystem 0
set filesystemReport
}
- -result {* {stat foo}}
+ -result {*{stat foo}}
}
test filesystem-4.2 {testfilesystem} {
@@ -384,7 +384,7 @@ test filesystem-4.2 {testfilesystem} {
testfilesystem 0
set filesystemReport
}
- -result {* {lstat foo}}
+ -result {*{lstat foo}}
}
test filesystem-4.3 {testfilesystem} {
@@ -397,7 +397,7 @@ test filesystem-4.3 {testfilesystem} {
testfilesystem 0
set filesystemReport
}
- -result {* {matchindirectory *}*}
+ -result {*{matchindirectory *}*}
}
test filesystem-5.1 {cache and ~} {
diff --git a/tests/winFCmd.test b/tests/winFCmd.test
index 5f0ff6a..6fc58a8 100644
--- a/tests/winFCmd.test
+++ b/tests/winFCmd.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: winFCmd.test,v 1.25 2003/12/09 14:57:18 vincentdarley Exp $
+# RCS: @(#) $Id: winFCmd.test,v 1.26 2004/01/21 19:59:34 vincentdarley Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -610,7 +610,7 @@ test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} {pcOnly nt} {
# WinXP returns EEXIST, WinNT seems to return EACCES. No policy
# decision has been made as to which is correct.
regsub {E(ACCES|EXIST)} $res "EACCES or EEXIST"
-} [list 1 [list [file norm /] EACCES or EEXIST]]
+} [list 1 [list / EACCES or EEXIST]]
test winFCmd-6.12 {TclpRemoveDirectory: errno == EACCES} {pcOnly 95} {
cleanup
createfile tf1