From d4de38cc67e8a8fd31ca629bd60fe48188d14fa7 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 31 Oct 2004 17:36:41 +0000 Subject: General clean up --- tests/fileSystem.test | 253 +++++++++++++------------------------------------- 1 file changed, 63 insertions(+), 190 deletions(-) diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 8ece283..3eb950a 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -12,14 +12,13 @@ package require tcltest 2 namespace eval ::tcl::test::fileSystem { - catch { - namespace import ::tcltest::cleanupTests - namespace import ::tcltest::makeDirectory - namespace import ::tcltest::makeFile - namespace import ::tcltest::removeDirectory - namespace import ::tcltest::removeFile - namespace import ::tcltest::test - } + namespace import ::tcltest::cleanupTests + namespace import ::tcltest::makeDirectory + namespace import ::tcltest::makeFile + namespace import ::tcltest::removeDirectory + namespace import ::tcltest::removeFile + namespace import ::tcltest::test + namespace import ::tcltest::testConstraint catch { file delete -force link.file @@ -27,19 +26,24 @@ namespace eval ::tcl::test::fileSystem { file delete -force [file join dir.dir linkinside.file] } +# Test for commands defined in Tcltest executable +testConstraint testfilesystem [llength [info commands ::testfilesystem]] +testConstraint testsetplatform [llength [info commands ::testsetplatform]] +testConstraint testsimplefilesystem [llength [info commands ::testsimplefilesystem]] + makeFile "test file" gorp.file makeDirectory dir.dir makeDirectory [file join dir.dir dirinside.dir] makeFile "test file in directory" [file join dir.dir inside.file] -tcltest::testConstraint unusedDrive 0 +testConstraint unusedDrive 0 set drive {} if {$::tcl_platform(platform) eq "windows"} { set vols [string map [list :/ {}] [file volumes]] for {set i 0} {$i < 26} {incr i} { set drive [format %c [expr {$i + 65}]] if {[lsearch -exact $vols $drive] == -1} { - tcltest::testConstraint unusedDrive 1 + testConstraint unusedDrive 1 break } } @@ -47,7 +51,7 @@ if {$::tcl_platform(platform) eq "windows"} { # The variable 'drive' will be used below } -tcltest::testConstraint moreThanOneDrive 0 +testConstraint moreThanOneDrive 0 set drives [list] if {$::tcl_platform(platform) eq "windows"} { set dir [pwd] @@ -57,7 +61,7 @@ if {$::tcl_platform(platform) eq "windows"} { } } if {[llength $drives] > 1} { - tcltest::testConstraint moreThanOneDrive 1 + testConstraint moreThanOneDrive 1 } # The variable 'drives' will be used below unset vol @@ -66,103 +70,82 @@ if {$::tcl_platform(platform) eq "windows"} { } proc testPathEqual {one two} { - if {[string equal $one $two]} { + if {$one eq $two} { return 1 } else { return "not equal: $one $two" } } -if {[catch { +testConstraint hasLinks [expr {![catch { file link link.file gorp.file cd dir.dir file link \ - [file join linkinside.file] \ - [file join inside.file] + [file join linkinside.file] \ + [file join inside.file] cd .. file link dir.link dir.dir cd dir.dir file link [file join dirinside.link] \ - [file join dirinside.dir] + [file join dirinside.dir] cd .. -}]} { - tcltest::testConstraint hasLinks 0 -} else { - tcltest::testConstraint hasLinks 1 -} +}]}] -tcltest::testConstraint testsetplatform [string equal testsetplatform [info commands testsetplatform]] -if {[tcltest::testConstraint testsetplatform]} { +if {[testConstraint testsetplatform]} { set platform [testgetplatform] } -tcltest::testConstraint testsimplefilesystem \ - [string equal testsimplefilesystem [info commands testsimplefilesystem]] - test filesystem-1.0 {link normalisation} {hasLinks} { string equal [file normalize gorp.file] [file normalize link.file] } {0} - test filesystem-1.1 {link normalisation} {hasLinks} { string equal [file normalize dir.dir] [file normalize dir.link] } {0} - test filesystem-1.2 {link normalisation} {hasLinks unix} { testPathEqual [file normalize [file join gorp.file foo]] \ - [file normalize [file join link.file foo]] + [file normalize [file join link.file foo]] } {1} - test filesystem-1.3 {link normalisation} {hasLinks} { testPathEqual [file normalize [file join dir.dir foo]] \ - [file normalize [file join dir.link foo]] + [file normalize [file join dir.link foo]] } {1} - test filesystem-1.4 {link normalisation} {hasLinks} { testPathEqual [file normalize [file join dir.dir inside.file]] \ - [file normalize [file join dir.link inside.file]] + [file normalize [file join dir.link inside.file]] } {1} - test filesystem-1.5 {link normalisation} {hasLinks} { testPathEqual [file normalize [file join dir.dir linkinside.file]] \ - [file normalize [file join dir.dir linkinside.file]] + [file normalize [file join dir.dir linkinside.file]] } {1} - test filesystem-1.6 {link normalisation} {hasLinks} { string equal [file normalize [file join dir.dir linkinside.file]] \ [file normalize [file join dir.link inside.file]] } {0} - test filesystem-1.7 {link normalisation} {hasLinks unix} { testPathEqual [file normalize [file join dir.link linkinside.file foo]] \ - [file normalize [file join dir.dir inside.file foo]] + [file normalize [file join dir.dir inside.file foo]] } {1} - test filesystem-1.8 {link normalisation} {hasLinks} { string equal [file normalize [file join dir.dir linkinside.filefoo]] \ - [file normalize [file join dir.link inside.filefoo]] + [file normalize [file join dir.link inside.filefoo]] } {0} - test filesystem-1.9 {link normalisation} {unix hasLinks} { file delete -force dir.link file link dir.link [file nativename dir.dir] testPathEqual [file normalize [file join dir.dir linkinside.file foo]] \ - [file normalize [file join dir.link inside.file foo]] + [file normalize [file join dir.link inside.file foo]] } {1} - test filesystem-1.10 {link normalisation: double link} {unix hasLinks} { file link dir2.link dir.link testPathEqual [file normalize [file join dir.dir linkinside.file foo]] \ - [file normalize [file join dir2.link inside.file foo]] + [file normalize [file join dir2.link inside.file foo]] } {1} - makeDirectory dir2.file - test filesystem-1.11 {link normalisation: double link, back in tree} {unix hasLinks} { file link [file join dir2.file dir2.link] [file join .. dir2.link] testPathEqual [file normalize [file join dir.dir linkinside.file foo]] \ - [file normalize [file join dir2.file dir2.link inside.file foo]] + [file normalize [file join dir2.file dir2.link inside.file foo]] } {1} - test filesystem-1.12 {file new native path} {} { for {set i 0} {$i < 10} {incr i} { foreach f [lsort [glob -nocomplain -type l *]] { @@ -172,89 +155,71 @@ test filesystem-1.12 {file new native path} {} { # If we reach here we've succeeded. We used to crash above. expr 1 } {1} - test filesystem-1.13 {file normalisation} {win} { # This used to be broken file normalize C:/thislongnamedoesntexist } {C:/thislongnamedoesntexist} - test filesystem-1.14 {file normalisation} {win} { # This used to be broken file normalize c:/ } {C:/} - test filesystem-1.15 {file normalisation} {win} { file normalize c:/../ } {C:/} - test filesystem-1.16 {file normalisation} {win} { file normalize c:/. } {C:/} - test filesystem-1.17 {file normalisation} {win} { file normalize c:/.. } {C:/} - test filesystem-1.17.1 {file normalisation} {win} { file normalize c:\\.. } {C:/} - test filesystem-1.18 {file normalisation} {win} { file normalize c:/./ } {C:/} - test filesystem-1.19 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./../../.. } "${drive}:/" - test filesystem-1.20 {file normalisation} {win} { file normalize //name/foo/../ } {//name/foo} - test filesystem-1.21 {file normalisation} {win} { file normalize C:///foo/./ } {C:/foo} - test filesystem-1.22 {file normalisation} {win} { file normalize //name/foo/. } {//name/foo} - test filesystem-1.23 {file normalisation} {win} { file normalize c:/./foo } {C:/foo} - test filesystem-1.24 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./../../../a } "${drive}:/a" - test filesystem-1.25 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./.././../../a } "${drive}:/a" - test filesystem-1.25.1 {file normalisation} {win unusedDrive} { file normalize ${drive}:/./.././..\\..\\a\\bb } "${drive}:/a/bb" - test filesystem-1.26 {link normalisation: link and ..} {hasLinks} { file delete -force dir2.link set dir [file join dir2 foo bar] file mkdir $dir file link dir2.link [file join dir2 foo bar] set res [list [file normalize [file join dir2 foo x]] \ - [file normalize [file join dir2.link .. x]]] + [file normalize [file join dir2.link .. x]]] if {![string equal [lindex $res 0] [lindex $res 1]]} { set res "$res not equal" } else { set res "ok" } } {ok} - test filesystem-1.27 {file normalisation: up and down with ..} { set dir [file join dir2 foo bar] file mkdir $dir set dir2 [file join dir2 .. dir2 foo .. foo bar] - set res [list [file normalize $dir] \ - [file normalize $dir2]] + set res [list [file normalize $dir] [file normalize $dir2]] set res2 [list [file exists $dir] [file exists $dir2]] if {![string equal [lindex $res 0] [lindex $res 1]]} { set res "exists: $res2, $res not equal" @@ -262,7 +227,6 @@ test filesystem-1.27 {file normalisation: up and down with ..} { set res "ok: $res2" } } {ok: 1 1} - test filesystem-1.28 {link normalisation: link with .. and ..} {hasLinks} { file delete -force dir2.link set dir [file join dir2 foo bar] @@ -270,14 +234,13 @@ test filesystem-1.28 {link normalisation: link with .. and ..} {hasLinks} { set to [file join dir2 .. dir2 foo .. foo bar] file link dir2.link $to set res [list [file normalize [file join dir2 foo x]] \ - [file normalize [file join dir2.link .. x]]] + [file normalize [file join dir2.link .. x]]] if {![string equal [lindex $res 0] [lindex $res 1]]} { set res "$res not equal" } else { set res "ok" } } {ok} - test filesystem-1.29 {link normalisation: link with ..} {hasLinks} { file delete -force dir2.link set dir [file join dir2 foo bar] @@ -291,12 +254,10 @@ test filesystem-1.29 {link normalisation: link with ..} {hasLinks} { set res "ok" } } {ok} - test filesystem-1.29.1 {link normalisation with two consecutive links} {hasLinks} { testPathEqual [file normalize [file join dir.link dirinside.link abc]] \ - [file normalize [file join dir.dir dirinside.dir abc]] + [file normalize [file join dir.dir dirinside.dir abc]] } {1} - file delete -force dir2.file file delete -force dir2.link file delete -force link.file dir.link @@ -305,21 +266,17 @@ file delete -force [file join dir.dir dirinside.link] removeFile [file join dir.dir inside.file] removeDirectory [file join dir.dir dirinside.dir] removeDirectory dir.dir - test filesystem-1.30 {normalisation of nonexistent user} { list [catch {file normalize ~noonewiththisname} err] $err } {1 {user "noonewiththisname" doesn't exist}} - test filesystem-1.31 {link normalisation: link near filesystem root} {testsetplatform} { testsetplatform unix file normalize /foo/../bar } {/bar} - test filesystem-1.32 {link normalisation: link near filesystem root} {testsetplatform} { testsetplatform unix file normalize /../bar } {/bar} - test filesystem-1.33 {link normalisation: link near filesystem root} {testsetplatform} { testsetplatform windows set res [file normalize C:/../bar] @@ -330,11 +287,9 @@ test filesystem-1.33 {link normalisation: link near filesystem root} {testsetpla } set res } {C:/bar} - -if {[tcltest::testConstraint testsetplatform]} { +if {[testConstraint testsetplatform]} { testsetplatform $platform } - test filesystem-1.34 {file normalisation with '/./'} { set res [file normalize /foo/bar/anc/./.tml] if {[string first "/./" $res] != -1} { @@ -344,7 +299,6 @@ test filesystem-1.34 {file normalisation with '/./'} { } set res } {ok} - test filesystem-1.35 {file normalisation with '/./'} { set res [file normalize /ffo/bar/anc/./foo/.tml] if {[string first "/./" $res] != -1 || ([regsub -all "foo" $res "" reg] == 2)} { @@ -354,7 +308,6 @@ test filesystem-1.35 {file normalisation with '/./'} { } set res } {ok} - test filesystem-1.36 {file normalisation with '/./'} { set res [file normalize /foo/bar/anc/././asdasd/.tml] if {[string first "/./" $res] != -1 || ([regsub -all "asdasd" $res "" reg] == 2) } { @@ -364,7 +317,6 @@ test filesystem-1.36 {file normalisation with '/./'} { } set res } {ok} - test filesystem-1.37 {file normalisation with '/./'} { set fname "/abc/./def/./ghi/./asda/.././.././asd/x/../../../../....." set res [file norm $fname] @@ -375,7 +327,6 @@ test filesystem-1.37 {file normalisation with '/./'} { } set res } {ok} - test filesystem-1.38 {file normalisation with volume relative} \ {win moreThanOneDrive} { set path "[string range [lindex $drives 0] 0 1]foo" @@ -385,7 +336,6 @@ test filesystem-1.38 {file normalisation with volume relative} \ cd $dir set res } "[lindex $drives 0]foo" - test filesystem-1.39 {file normalisation with volume relative} {win} { set drv C:/ set dir [lindex [glob -type d -dir $drv *] 0] @@ -399,7 +349,6 @@ test filesystem-1.39 {file normalisation with volume relative} {win} { set res "ok" } } {ok} - test filesystem-1.40 {file normalisation with repeated separators} { set a [file norm foo////bar] set b [file norm foo/bar] @@ -410,7 +359,6 @@ test filesystem-1.40 {file normalisation with repeated separators} { set res "ok" } } {ok} - test filesystem-1.41 {file normalisation with repeated separators} {win} { set a [file norm foo\\\\\\bar] set b [file norm foo/bar] @@ -430,52 +378,37 @@ test filesystem-2.0 {new native path} {unix} { expr 1 } {1} -if {[catch {package require tcltest 2}]} { - puts stderr "Skipping tests filesystem-{3,4}.*: tcltest 2 required." -} else { - namespace import ::tcltest::testConstraint - - # Is the Tcltest package loaded? - # - that is, the special C-coded testing commands in tclTest.c - # - tests use testing commands introduced in Tcltest 8.4 - testConstraint Tcltest [expr { - [llength [package provide Tcltest]] - && [package vsatisfies [package provide Tcltest] 8.4]}] - # Make sure the testfilesystem hasn't been registered. -while {![catch {testfilesystem 0}]} {} +if {[testConstraint testfilesystem]} { + while {![catch {testfilesystem 0}]} {} +} -test filesystem-3.0 {Tcl_FSRegister} Tcltest { +test filesystem-3.0 {Tcl_FSRegister} testfilesystem { testfilesystem 1 } {registered} - -test filesystem-3.1 {Tcl_FSUnregister} Tcltest { +test filesystem-3.1 {Tcl_FSUnregister} testfilesystem { testfilesystem 0 } {unregistered} - -test filesystem-3.2 {Tcl_FSUnregister} Tcltest { +test filesystem-3.2 {Tcl_FSUnregister} testfilesystem { list [catch {testfilesystem 0} err] $err } {1 failed} - -test filesystem-3.3 {Tcl_FSRegister} Tcltest { +test filesystem-3.3 {Tcl_FSRegister} testfilesystem { testfilesystem 1 testfilesystem 1 testfilesystem 0 testfilesystem 0 } {unregistered} - -test filesystem-3.4 {Tcl_FSRegister} Tcltest { +test filesystem-3.4 {Tcl_FSRegister} testfilesystem { testfilesystem 1 file system bar } {reporting} - -test filesystem-3.5 {Tcl_FSUnregister} Tcltest { +test filesystem-3.5 {Tcl_FSUnregister} testfilesystem { testfilesystem 0 lindex [file system bar] 0 } {native} test filesystem-4.0 {testfilesystem} { - -constraints Tcltest + -constraints testfilesystem -match glob -body { testfilesystem 1 @@ -486,9 +419,8 @@ test filesystem-4.0 {testfilesystem} { } -result {*{access foo}} } - test filesystem-4.1 {testfilesystem} { - -constraints Tcltest + -constraints testfilesystem -match glob -body { testfilesystem 1 @@ -499,9 +431,8 @@ test filesystem-4.1 {testfilesystem} { } -result {*{stat foo}} } - test filesystem-4.2 {testfilesystem} { - -constraints Tcltest + -constraints testfilesystem -match glob -body { testfilesystem 1 @@ -512,9 +443,8 @@ test filesystem-4.2 {testfilesystem} { } -result {*{lstat foo}} } - test filesystem-4.3 {testfilesystem} { - -constraints Tcltest + -constraints testfilesystem -match glob -body { testfilesystem 1 @@ -527,7 +457,7 @@ test filesystem-4.3 {testfilesystem} { } test filesystem-5.1 {cache and ~} { - -constraints Tcltest + -constraints testfilesystem -match regexp -body { set orig $env(HOME) @@ -545,137 +475,106 @@ test filesystem-5.1 {cache and ~} { test filesystem-6.1 {empty file name} { list [catch {open ""} msg] $msg } {1 {couldn't open "": no such file or directory}} - test filesystem-6.2 {empty file name} { list [catch {file stat "" arr} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.3 {empty file name} { list [catch {file atime ""} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.4 {empty file name} { list [catch {file attributes ""} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.5 {empty file name} { list [catch {file copy "" ""} msg] $msg } {1 {error copying "": no such file or directory}} - test filesystem-6.6 {empty file name} { list [catch {file delete ""} msg] $msg } {0 {}} - test filesystem-6.7 {empty file name} { list [catch {file dirname ""} msg] $msg } {0 .} - test filesystem-6.8 {empty file name} { list [catch {file executable ""} msg] $msg } {0 0} - test filesystem-6.9 {empty file name} { list [catch {file exists ""} msg] $msg } {0 0} - test filesystem-6.10 {empty file name} { list [catch {file extension ""} msg] $msg } {0 {}} - test filesystem-6.11 {empty file name} { list [catch {file isdirectory ""} msg] $msg } {0 0} - test filesystem-6.12 {empty file name} { list [catch {file isfile ""} msg] $msg } {0 0} - test filesystem-6.13 {empty file name} { list [catch {file join ""} msg] $msg } {0 {}} - test filesystem-6.14 {empty file name} { list [catch {file link ""} msg] $msg } {1 {could not read link "": no such file or directory}} - test filesystem-6.15 {empty file name} { list [catch {file lstat "" arr} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.16 {empty file name} { list [catch {file mtime ""} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.17 {empty file name} { list [catch {file mtime "" 0} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.18 {empty file name} { list [catch {file mkdir ""} msg] $msg } {1 {can't create directory "": no such file or directory}} - test filesystem-6.19 {empty file name} { list [catch {file nativename ""} msg] $msg } {0 {}} - test filesystem-6.20 {empty file name} { list [catch {file normalize ""} msg] $msg } {0 {}} - test filesystem-6.21 {empty file name} { list [catch {file owned ""} msg] $msg } {0 0} - test filesystem-6.22 {empty file name} { list [catch {file pathtype ""} msg] $msg } {0 relative} - test filesystem-6.23 {empty file name} { list [catch {file readable ""} msg] $msg } {0 0} - test filesystem-6.24 {empty file name} { list [catch {file readlink ""} msg] $msg } {1 {could not readlink "": no such file or directory}} - test filesystem-6.25 {empty file name} { list [catch {file rename "" ""} msg] $msg } {1 {error renaming "": no such file or directory}} - test filesystem-6.26 {empty file name} { list [catch {file rootname ""} msg] $msg } {0 {}} - test filesystem-6.27 {empty file name} { list [catch {file separator ""} msg] $msg } {1 {Unrecognised path}} - test filesystem-6.28 {empty file name} { list [catch {file size ""} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.29 {empty file name} { list [catch {file split ""} msg] $msg } {0 {}} - test filesystem-6.30 {empty file name} { list [catch {file system ""} msg] $msg } {1 {Unrecognised path}} - test filesystem-6.31 {empty file name} { list [catch {file tail ""} msg] $msg } {0 {}} - test filesystem-6.32 {empty file name} { list [catch {file type ""} msg] $msg } {1 {could not read "": no such file or directory}} - test filesystem-6.33 {empty file name} { list [catch {file writable ""} msg] $msg } {0 0} # Make sure the testfilesystem hasn't been registered. -while {![catch {testfilesystem 0}]} {} +if {[testConstraint testfilesystem]} { + while {![catch {testfilesystem 0}]} {} } test filesystem-7.1 {load from vfs} {win testsimplefilesystem} { @@ -691,7 +590,6 @@ test filesystem-7.1 {load from vfs} {win testsimplefilesystem} { set res "ok" # The real result of this test is what happens when Tcl exits. } {ok} - test filesystem-7.2 {cross-filesystem copy from vfs maintains mtime} \ {testsimplefilesystem} { set dir [pwd] @@ -713,9 +611,7 @@ test filesystem-7.2 {cross-filesystem copy from vfs maintains mtime} \ cd $dir lappend res [expr {$origtime == $newtime}] } {1 1} - -test filesystem-7.3 {glob in simplefs} \ - {testsimplefilesystem} { +test filesystem-7.3 {glob in simplefs} testsimplefilesystem { set dir [pwd] cd [tcltest::temporaryDirectory] file mkdir simpledir @@ -727,9 +623,7 @@ test filesystem-7.3 {glob in simplefs} \ cd $dir set res } {simplefs:/simpledir/simplefile} - -test filesystem-7.3.1 {glob in simplefs: no path/dir} \ - {testsimplefilesystem} { +test filesystem-7.3.1 {glob in simplefs: no path/dir} testsimplefilesystem { set dir [pwd] cd [tcltest::temporaryDirectory] file mkdir simpledir @@ -742,9 +636,7 @@ test filesystem-7.3.1 {glob in simplefs: no path/dir} \ cd $dir set res } {simplefs:/simpledir/simplefile simplefs:/simpledir} - -test filesystem-7.3.2 {glob in simplefs: no path/dir, no subdirectory} \ - {testsimplefilesystem} { +test filesystem-7.3.2 {glob in simplefs: no path/dir, no subdirectory} testsimplefilesystem { set dir [pwd] cd [tcltest::temporaryDirectory] file mkdir simpledir @@ -760,9 +652,7 @@ test filesystem-7.3.2 {glob in simplefs: no path/dir, no subdirectory} \ set res "no files found with 'glob -nocomplain simplefs:/s*'" } } {ok} - -test filesystem-7.3.3 {glob in simplefs: pattern is a volume} \ - {testsimplefilesystem} { +test filesystem-7.3.3 {glob in simplefs: pattern is a volume} testsimplefilesystem { set dir [pwd] cd [tcltest::temporaryDirectory] file mkdir simpledir @@ -778,9 +668,7 @@ test filesystem-7.3.3 {glob in simplefs: pattern is a volume} \ set res "no files found with 'glob -nocomplain simplefs:/*'" } } {ok} - -test filesystem-7.4 {cross-filesystem file copy with -force} \ - {testsimplefilesystem} { +test filesystem-7.4 {cross-filesystem file copy with -force} testsimplefilesystem { set dir [pwd] cd [tcltest::temporaryDirectory] set fout [open [file join simplefile] w] @@ -803,9 +691,7 @@ test filesystem-7.4 {cross-filesystem file copy with -force} \ cd $dir set res } {0 10 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 10 1} - -test filesystem-7.5 {cross-filesystem file copy with -force} \ - {testsimplefilesystem unix} { +test filesystem-7.5 {cross-filesystem file copy with -force} {testsimplefilesystem unix} { set dir [pwd] cd [tcltest::temporaryDirectory] set fout [open [file join simplefile] w] @@ -829,9 +715,7 @@ test filesystem-7.5 {cross-filesystem file copy with -force} \ cd $dir set res } {0 10 1 {error copying "simplefs:/simplefile" to "file2": file already exists} 0 10 1} - -test filesystem-7.6 {cross-filesystem dir copy with -force} \ - {testsimplefilesystem} { +test filesystem-7.6 {cross-filesystem dir copy with -force} testsimplefilesystem { set dir [pwd] cd [tcltest::temporaryDirectory] file delete -force simpledir @@ -851,16 +735,14 @@ test filesystem-7.6 {cross-filesystem dir copy with -force} \ lappend res [catch {file copy -force simplefs:/simpledir dir2} err] lappend res $err lappend res [file exists [file join dir2 simpledir]] \ - [file exists [file join dir2 simpledir simplefile]] + [file exists [file join dir2 simpledir simplefile]] testsimplefilesystem 0 file delete -force simpledir file delete -force dir2 cd $dir set res } {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file already exists} 0 {} 1 1} - -test filesystem-7.7 {cross-filesystem dir copy with -force} \ - {testsimplefilesystem unix} { +test filesystem-7.7 {cross-filesystem dir copy with -force} {testsimplefilesystem unix} { set dir [pwd] cd [tcltest::temporaryDirectory] file delete -force simpledir @@ -883,16 +765,14 @@ test filesystem-7.7 {cross-filesystem dir copy with -force} \ lappend res [catch {file copy -force simplefs:/simpledir dir2} err] lappend res $err lappend res [file exists [file join dir2 simpledir]] \ - [file exists [file join dir2 simpledir simplefile]] + [file exists [file join dir2 simpledir simplefile]] testsimplefilesystem 0 file delete -force simpledir file delete -force dir2 cd $dir set res } {0 {} 1 {error copying "simplefs:/simpledir" to "dir2/simpledir": file already exists} 0 {} 1 1} - removeFile gorp.file - test filesystem-7.8 {vfs cd} testsimplefilesystem { set dir [pwd] cd [tcltest::temporaryDirectory] @@ -933,7 +813,6 @@ test filesystem-8.1 {relative path objects and caching of pwd} { cd $dir set res } {1 1 0 0} - test filesystem-8.2 {relative path objects and use of pwd} { set origdir [pwd] cd [tcltest::temporaryDirectory] @@ -948,7 +827,6 @@ test filesystem-8.2 {relative path objects and use of pwd} { cd $origdir set res } {1} - test filesystem-8.3 {path objects and empty string} { set anchor "" set dst foo @@ -985,7 +863,6 @@ test filesystem-9.1 {path objects and join and object rep} { cd $origdir set res } {{a/b/./c found: 1} {is dir a dir? 1} {a/b/./c found: 1}} - test filesystem-9.2 {path objects and join and object rep} { set origdir [pwd] cd [tcltest::temporaryDirectory] @@ -995,7 +872,6 @@ test filesystem-9.2 {path objects and join and object rep} { cd $origdir set res } {{a/b/./c found: 1} {is dir a dir? 1} {a/b/./c found: 1}} - test filesystem-9.2.1 {path objects and join and object rep} { set origdir [pwd] cd [tcltest::temporaryDirectory] @@ -1005,7 +881,6 @@ test filesystem-9.2.1 {path objects and join and object rep} { cd $origdir set res } {{a/b/. found: 1} {is dir a dir? 1} {a/b/. found: 1}} - test filesystem-9.3 {path objects and join and object rep} { set origdir [pwd] cd [tcltest::temporaryDirectory] @@ -1015,7 +890,6 @@ test filesystem-9.3 {path objects and join and object rep} { cd $origdir set res } {{a/b/../b/c found: 1} {is dir a dir? 1} {a/b/../b/c found: 1}} - test filesystem-9.4 {path objects and join and object rep} { set origdir [pwd] cd [tcltest::temporaryDirectory] @@ -1025,7 +899,6 @@ test filesystem-9.4 {path objects and join and object rep} { cd $origdir set res } {{a/b/../b/c found: 1} {is dir a dir? 1} {a/b/../b/c found: 1}} - test filesystem-9.5 {path objects and file tail and object rep} { set origdir [pwd] cd [tcltest::temporaryDirectory] -- cgit v0.12