summaryrefslogtreecommitdiffstats
path: root/tests/fileSystem.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-03-21 11:12:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-03-21 11:12:27 (GMT)
commit86ca5531ac0818f99726ba9ad478e277cd5d6e94 (patch)
treecb78904bbef94025a4f19257afc9211ee618e8ce /tests/fileSystem.test
parentd4070e928ea23c067c492b5e594d206a76d9b3d5 (diff)
downloadtcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.zip
tcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.tar.gz
tcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.tar.bz2
Use test constraints properly instead of looking in tcl_platform
Consistent method of calling test constraints, and (try to) move constraint setup to the top of the test file
Diffstat (limited to 'tests/fileSystem.test')
-rw-r--r--tests/fileSystem.test16
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index 7487743..06ab643 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -11,15 +11,8 @@
package require tcltest 2
namespace eval ::tcl::test::fileSystem {
+ namespace import ::tcltest::*
- 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
file delete -force dir.link
@@ -39,7 +32,7 @@ makeFile "test file in directory" [file join dir.dir inside.file]
testConstraint unusedDrive 0
set drive {}
-if {$::tcl_platform(platform) eq "windows"} {
+if {[testConstraint win]} {
set vols [string map [list :/ {}] [file volumes]]
for {set i 0} {$i < 26} {incr i} {
set drive [format %c [expr {$i + 65}]]
@@ -54,7 +47,7 @@ if {$::tcl_platform(platform) eq "windows"} {
testConstraint moreThanOneDrive 0
set drives [list]
-if {$::tcl_platform(platform) eq "windows"} {
+if {[testConstraint win]} {
set dir [pwd]
foreach vol [file volumes] {
if {![catch {cd $vol}]} {
@@ -281,7 +274,7 @@ test filesystem-1.32 {link normalisation: link near filesystem root} {testsetpla
test filesystem-1.33 {link normalisation: link near filesystem root} {testsetplatform} {
testsetplatform windows
set res [file normalize C:/../bar]
- if {$::tcl_platform(platform) == "unix"} {
+ if {[testConstraint unix]} {
# Some unices go further in normalizing this -- not really
# a problem since this is a Windows test
regexp {C:/bar$} $res res
@@ -902,7 +895,6 @@ test filesystem-8.3 {path objects and empty string} {
set anchor ""
set dst foo
set res $dst
-
set yyy [file split $anchor]
set dst [file join $anchor $dst]
lappend res $dst $yyy