summaryrefslogtreecommitdiffstats
path: root/tests/winFile.test
diff options
context:
space:
mode:
authorstanton <stanton>1999-04-16 00:46:29 (GMT)
committerstanton <stanton>1999-04-16 00:46:29 (GMT)
commit97464e6cba8eb0008cf2727c15718671992b913f (patch)
treece9959f2747257d98d52ec8d18bf3b0de99b9535 /tests/winFile.test
parenta8c96ddb94d1483a9de5e340b740cb74ef6cafa7 (diff)
downloadtcl-97464e6cba8eb0008cf2727c15718671992b913f.zip
tcl-97464e6cba8eb0008cf2727c15718671992b913f.tar.gz
tcl-97464e6cba8eb0008cf2727c15718671992b913f.tar.bz2
merged tcl 8.1 branch back into the main trunk
Diffstat (limited to 'tests/winFile.test')
-rw-r--r--tests/winFile.test64
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/winFile.test b/tests/winFile.test
new file mode 100644
index 0000000..677150d
--- /dev/null
+++ b/tests/winFile.test
@@ -0,0 +1,64 @@
+# 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.
+# 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.
+#
+# RCS: @(#) $Id: winFile.test,v 1.2 1999/04/16 00:47:37 stanton Exp $
+
+if {[lsearch [namespace children] ::tcltest] == -1} {
+ source [file join [pwd] [file dirname [info script]] defs.tcl]
+}
+
+test winFile-1.1 {TclpGetUserHome} {pcOnly} {
+ list [catch {glob ~nosuchuser} msg] $msg
+} {1 {user "nosuchuser" doesn't exist}}
+test winFile-1.2 {TclpGetUserHome} {nt nonPortable} {
+ # The administrator account should always exist.
+
+ catch {glob ~administrator}
+} {0}
+test winFile-1.2 {TclpGetUserHome} {95} {
+ # 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}
+test winFile-1.3 {TclpGetUserHome} {nt nonPortable} {
+ catch {glob ~stanton@workgroup}
+} {0}
+
+# cleanup
+::tcltest::cleanupTests
+return
+
+
+
+
+
+
+
+
+
+
+
+