summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-03-20 15:41:10 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-03-20 15:41:10 (GMT)
commit4749a2ccca65ed1543504717b225e5e3641395c8 (patch)
treec885a310a058a192f48eefa8a475fe8bc4bcd62e /tests
parentfe8cfd7fccfd0c39bd50ac44e0902db6b11bc6ea (diff)
downloadtcl-4749a2ccca65ed1543504717b225e5e3641395c8.zip
tcl-4749a2ccca65ed1543504717b225e5e3641395c8.tar.gz
tcl-4749a2ccca65ed1543504717b225e5e3641395c8.tar.bz2
Clean up the constraint handling
Diffstat (limited to 'tests')
-rw-r--r--tests/winFile.test37
1 files changed, 16 insertions, 21 deletions
diff --git a/tests/winFile.test b/tests/winFile.test
index b8837db..6d5377a 100644
--- a/tests/winFile.test
+++ b/tests/winFile.test
@@ -1,16 +1,16 @@
# This file tests the tclWinFile.c file.
#
-# This file contains a collection of tests for one or more of the Tcl
-# built-in commands. Sourcing this file into Tcl runs the tests and
-# generates output for errors. No output means no errors were found.
+# This file contains a collection of tests for one or more of the Tcl built-in
+# commands. Sourcing this file into Tcl runs the tests and generates output
+# for errors. No output means no errors were found.
#
# Copyright (c) 1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+# See the file "license.terms" for information on usage and redistribution of
+# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: winFile.test,v 1.17 2005/10/05 00:38:05 hobbs Exp $
+# RCS: @(#) $Id: winFile.test,v 1.18 2006/03/20 15:41:10 dkf Exp $
if {[catch {package require tcltest 2.0.2}]} {
puts stderr "Skipping tests in [info script]. tcltest 2.0.2 required."
@@ -18,20 +18,15 @@ if {[catch {package require tcltest 2.0.2}]} {
}
namespace import -force ::tcltest::*
-if {[info commands ::testvolumetype] == ""} {
- tcltest::testConstraint notNTFS 0
-} else {
- if {![string equal "NTFS" [testvolumetype]]} {
- tcltest::testConstraint notNTFS 0
- } else {
- tcltest::testConstraint notNTFS 1
- }
+testConstraint testvolumetype [llength [info commands testvolumetype]]
+testConstraint notNTFS 0
+testConstraint win2000 0
+
+if {[testConstraint testvolumetype]} {
+ testConstraint notNTFS [expr {[testvolumetype] eq "NTFS"}]
}
-if {[string equal $::tcl_platform(os) "Windows NT"] &&
- $::tcl_platform(osVersion) >= 5.0} {
- tcltest::testConstraint win2000 1
-} else {
- tcltest::testConstraint win2000 0
+if {[testConstraint nt] && $::tcl_platform(osVersion) >= 5.0} {
+ testConstraint win2000 1
}
test winFile-1.1 {TclpGetUserHome} {win} {
@@ -78,7 +73,7 @@ test winFile-2.2 {TclpMatchFiles: case sensitivity} {win} {
set result
} {globlower globlower}
-test winFile-3.1 {file system} {win} {
+test winFile-3.1 {file system} {win testvolumetype} {
set res "volume types ok"
foreach vol [file volumes] {
# Have to catch in case there is a removable drive (CDROM, floppy)
@@ -230,5 +225,5 @@ test winFile-4.4 {
file delete $fname
# cleanup
-::tcltest::cleanupTests
+cleanupTests
return