diff options
Diffstat (limited to 'tests/env.test')
-rw-r--r-- | tests/env.test | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/tests/env.test b/tests/env.test index fb8e22f..dcf5ab4 100644 --- a/tests/env.test +++ b/tests/env.test @@ -107,6 +107,7 @@ variable keep { CommonProgramFiles CommonProgramFiles(x86) ProgramFiles ProgramFiles(x86) CommonProgramW6432 ProgramW6432 WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR PROCESSOR_ARCHITECTURE + USERPROFILE } variable printenvScript [makeFile [string map [list @keep@ [list $keep]] { @@ -426,10 +427,10 @@ test env-7.5 { set env variable through upvar } -setup setup1 -body { apply {{} { - set ::env(test7_4) origvalue - upvar #0 env(test7_4) var + set ::env(test7_5) origvalue + upvar #0 env(test7_5) var set var newvalue - return $::env(test7_4) + return $::env(test7_5) }} } -cleanup cleanup1 -result newvalue @@ -437,10 +438,10 @@ test env-7.6 { unset env variable through upvar } -setup setup1 -body { apply {{} { - set ::env(test7_4) origvalue - upvar #0 env(test7_4) var + set ::env(test7_6) origvalue + upvar #0 env(test7_6) var unset var - return [array get env test7_4] + return [array get env test7_6] }} } -cleanup cleanup1 -result {} @@ -471,6 +472,45 @@ test env-8.0 { } -result {i'm with dummy} +test env-9.0 { + Initialization of HOME from HOMEDRIVE and HOMEPATH +} -constraints win -setup { + setup1 + unset -nocomplain ::env(HOME) + set ::env(HOMEDRIVE) X: + set ::env(HOMEPATH) \\home\\path +} -cleanup { + cleanup1 +} -body { + set pipe [open |[list [interpreter]] r+] + puts $pipe {puts $::env(HOME); flush stdout; exit} + flush $pipe + set result [gets $pipe] + close $pipe + set result +} -result {X:\home\path} + +test env-9.1 { + Initialization of HOME from USERPROFILE +} -constraints win -setup { + setup1 + unset -nocomplain ::env(HOME) + unset -nocomplain ::env(HOMEDRIVE) + unset -nocomplain ::env(HOMEPATH) +} -cleanup { + cleanup1 +} -body { + set pipe [open |[list [interpreter]] r+] + puts $pipe {puts $::env(HOME); flush stdout; exit} + flush $pipe + set result [gets $pipe] + close $pipe + if {$result ne $::env(USERPROFILE)} { + list ERROR $result ne $::env(USERPROFILE) + } +} -result {} + + # cleanup rename getenv {} |