blob: 82ed2b987e03002865bcd0dee167c51833dca3ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
|