diff options
author | stanton <stanton> | 1998-09-21 23:39:52 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-09-21 23:39:52 (GMT) |
commit | 494c2de3a748b449c69ce322a1a741f5a31fd4d5 (patch) | |
tree | c3ece48c0ae3f4ba54787e0e8e729b65752ef3f9 /tests/winFile.test | |
parent | 7a698c0488d99c0af42022714638ae1ba2afaa49 (diff) | |
download | tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.zip tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.tar.gz tcl-494c2de3a748b449c69ce322a1a741f5a31fd4d5.tar.bz2 |
Added contents of Tcl 8.1a2
Diffstat (limited to 'tests/winFile.test')
-rw-r--r-- | tests/winFile.test | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/winFile.test b/tests/winFile.test new file mode 100644 index 0000000..82ed2b9 --- /dev/null +++ b/tests/winFile.test @@ -0,0 +1,51 @@ +# 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. +# +# Copyright (c) 1997 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# SCCS: @(#) winFile.test 1.3 97/12/08 15:07:46 +# + +if {[info procs test] != "test"} { + source defs +} + +if {$tcl_platform(platform) != "windows"} { + return +} + +test winFile-1.1 {TclpGetUserHome} { + list [catch {glob ~nosuchuser} msg] $msg +} {1 {user "nosuchuser" doesn't exist}} +test winFile-1.2 {TclpGetUserHome} {nt} { + # The administrator account should always exist. + + catch {glob ~administrator} +} {0} +test winFile-1.2 {TclpGetUserHome} {!nt} { + # Find some user in system.ini and then see if they have a home. + + set f [open $::env(windir)/system.ini] + set x 0 + while {![eof $f]} { + set line [gets $f] + if {$line == "\[Password Lists]"} { + gets $f + set name [lindex [split [gets $f] =] 0] + if {$name != ""} { + set x [catch {glob ~$name}] + break + } + } + } + close $f + set x +} {0} + +return |