os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/winFile.test
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/winFile.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,95 @@
1.4 +# This file tests the tclWinFile.c file.
1.5 +#
1.6 +# This file contains a collection of tests for one or more of the Tcl
1.7 +# built-in commands. Sourcing this file into Tcl runs the tests and
1.8 +# generates output for errors. No output means no errors were found.
1.9 +#
1.10 +# Copyright (c) 1997 Sun Microsystems, Inc.
1.11 +# Copyright (c) 1998-1999 by Scriptics Corporation.
1.12 +#
1.13 +# See the file "license.terms" for information on usage and redistribution
1.14 +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1.15 +#
1.16 +# RCS: @(#) $Id: winFile.test,v 1.9.2.1 2003/04/14 15:45:58 vincentdarley Exp $
1.17 +
1.18 +if {[lsearch [namespace children] ::tcltest] == -1} {
1.19 + package require tcltest
1.20 + namespace import -force ::tcltest::*
1.21 +}
1.22 +
1.23 +test winFile-1.1 {TclpGetUserHome} {pcOnly} {
1.24 + list [catch {glob ~nosuchuser} msg] $msg
1.25 +} {1 {user "nosuchuser" doesn't exist}}
1.26 +test winFile-1.2 {TclpGetUserHome} {pcOnly nt nonPortable} {
1.27 + # The administrator account should always exist.
1.28 +
1.29 + catch {glob ~administrator}
1.30 +} {0}
1.31 +test winFile-1.3 {TclpGetUserHome} {pcOnly 95} {
1.32 + # Find some user in system.ini and then see if they have a home.
1.33 +
1.34 + set f [open $::env(windir)/system.ini]
1.35 + set x 0
1.36 + while {![eof $f]} {
1.37 + set line [gets $f]
1.38 + if {$line == "\[Password Lists]"} {
1.39 + gets $f
1.40 + set name [lindex [split [gets $f] =] 0]
1.41 + if {$name != ""} {
1.42 + set x [catch {glob ~$name}]
1.43 + break
1.44 + }
1.45 + }
1.46 + }
1.47 + close $f
1.48 + set x
1.49 +} {0}
1.50 +test winFile-1.4 {TclpGetUserHome} {pcOnly nt nonPortable} {
1.51 + catch {glob ~stanton@workgroup}
1.52 +} {0}
1.53 +
1.54 +test winFile-2.1 {TclpMatchFiles: case sensitivity} {pcOnly} {
1.55 + makeFile {} GlobCapS
1.56 + set result [list [glob -nocomplain GlobC*] [glob -nocomplain globc*]]
1.57 + removeFile GlobCapS
1.58 + set result
1.59 +} {GlobCapS GlobCapS}
1.60 +
1.61 +test winFile-2.2 {TclpMatchFiles: case sensitivity} {pcOnly} {
1.62 + makeFile {} globlower
1.63 + set result [list [glob -nocomplain globl*] [glob -nocomplain gLOBl*]]
1.64 + removeFile globlower
1.65 + set result
1.66 +} {globlower globlower}
1.67 +
1.68 +test winFile-3.1 {file system} {pcOnly} {
1.69 + set res "volume types ok"
1.70 + foreach vol [file volumes] {
1.71 + # Have to catch in case there is a removable drive (CDROM, floppy)
1.72 + # with nothing in it.
1.73 + catch {
1.74 + if {![string equal [lindex [file system $vol] 1] [testvolumetype $vol]]} {
1.75 + set res "For $vol, we found [file system $vol]\
1.76 + and [testvolumetype $vol] are different"
1.77 + break
1.78 + }
1.79 + }
1.80 + }
1.81 + set res
1.82 +} {volume types ok}
1.83 +
1.84 +# cleanup
1.85 +::tcltest::cleanupTests
1.86 +return
1.87 +
1.88 +
1.89 +
1.90 +
1.91 +
1.92 +
1.93 +
1.94 +
1.95 +
1.96 +
1.97 +
1.98 +