diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-09-07 13:47:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-09-07 13:47:45 (GMT) |
commit | c603f00cf1e79360cab83bed72e551df8b19fe56 (patch) | |
tree | 0500c242f43a2ebe9ca990809566a7f0a650f2c5 /tests | |
parent | 15640f92409edd55e33844d0b7c298ebce907ca3 (diff) | |
parent | 67be0a6752a150bad176f36988e3af03f25cc4d3 (diff) | |
download | tcl-c603f00cf1e79360cab83bed72e551df8b19fe56.zip tcl-c603f00cf1e79360cab83bed72e551df8b19fe56.tar.gz tcl-c603f00cf1e79360cab83bed72e551df8b19fe56.tar.bz2 |
Merge 8.7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/env.test | 42 | ||||
-rw-r--r-- | tests/httpd | 6 |
2 files changed, 46 insertions, 2 deletions
diff --git a/tests/env.test b/tests/env.test index 9eacd5d..dd88431 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]] { @@ -411,7 +412,7 @@ test env-7.3 { return [info exists ::env(test7_3)] }} } -cleanup cleanup1 -result 1 - + test env-8.0 { memory usage - valgrind does not report reachable memory } -body { @@ -421,6 +422,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 {} diff --git a/tests/httpd b/tests/httpd index 43e9372..a7b42a1 100644 --- a/tests/httpd +++ b/tests/httpd @@ -50,7 +50,7 @@ proc httpdAccept {newsock ipaddr port} { fconfigure $newsock -blocking 0 -translation {auto crlf} httpd_log $newsock Connect $ipaddr $port set data(ipaddr) $ipaddr - after 50 [list fileevent $newsock readable [list httpdRead $newsock]] + fileevent $newsock readable [list httpdRead $newsock] } # read data from a client request @@ -69,6 +69,10 @@ proc httpdRead { sock } { -> data(proto) data(url) data(query) data(httpversion)]} { set data(state) mime httpd_log $sock Query $line + if {[regexp {(?:^|[\?&])delay=([^&]+)} $data(query) {} val]} { + fileevent $sock readable {} + after $val [list fileevent $sock readable [list httpdRead $sock]] + } } else { httpdError $sock 400 httpd_log $sock Error "bad first line:$line" |