summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2022-11-09 13:45:46 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2022-11-09 13:45:46 (GMT)
commit973b944b33b10b6644cd90148dd53931ccd7f881 (patch)
tree2b8cf91646452a35a6b21feedb59e1ed03fd1770 /tests
parentc8a85bbc05960b91123999e18cdf1c872896dec7 (diff)
parente18b1490d5ec61c9b02def910eed94626e6d3231 (diff)
downloadtcl-973b944b33b10b6644cd90148dd53931ccd7f881.zip
tcl-973b944b33b10b6644cd90148dd53931ccd7f881.tar.gz
tcl-973b944b33b10b6644cd90148dd53931ccd7f881.tar.bz2
Merge trunk. Also update Tcl_ObjType.version to match TIP 644
Diffstat (limited to 'tests')
-rw-r--r--tests/binary.test83
-rw-r--r--tests/chan.test12
-rw-r--r--tests/chanio.test32
-rw-r--r--tests/encoding.test11
-rw-r--r--tests/env.test4
-rw-r--r--tests/http.test372
-rw-r--r--tests/http11.test98
-rw-r--r--tests/httpPipeline.test2
-rw-r--r--tests/httpProxy.test456
-rw-r--r--tests/httpProxySquidConfigForEL8.tar.gzbin0 -> 2266 bytes
-rw-r--r--tests/io.test36
-rw-r--r--tests/ioCmd.test12
-rw-r--r--tests/load.test2
-rw-r--r--tests/lreplace.test2
-rw-r--r--tests/lseq.test39
-rw-r--r--tests/main.test2
-rw-r--r--tests/scan.test2
-rw-r--r--tests/socket.test20
18 files changed, 878 insertions, 307 deletions
diff --git a/tests/binary.test b/tests/binary.test
index 56f5920..a947410 100644
--- a/tests/binary.test
+++ b/tests/binary.test
@@ -512,10 +512,10 @@ test binary-13.11 {Tcl_BinaryObjCmd: format} littleEndian {
} \xCD\xCC\xCC\x3F\x9A\x99\x59\x40
test binary-13.12 {Tcl_BinaryObjCmd: float overflow} bigEndian {
binary format f -3.402825e+38
-} \xFF\x7F\xFF\xFF
+} \xFF\x80\x00\x00
test binary-13.13 {Tcl_BinaryObjCmd: float overflow} littleEndian {
binary format f -3.402825e+38
-} \xFF\xFF\x7F\xFF
+} \x00\x00\x80\xFF
test binary-13.14 {Tcl_BinaryObjCmd: float underflow} bigEndian {
binary format f -3.402825e-100
} \x80\x00\x00\x00
@@ -537,6 +537,18 @@ test binary-13.19 {Tcl_BinaryObjCmd: format} littleEndian {
set a {1.6 3.4}
binary format f1 $a
} \xCD\xCC\xCC\x3F
+test binary-13.20 {Tcl_BinaryObjCmd: format float Inf} bigEndian {
+ binary format f Inf
+} \x7F\x80\x00\x00
+test binary-13.21 {Tcl_BinaryObjCmd: format float Inf} littleEndian {
+ binary format f Inf
+} \x00\x00\x80\x7F
+test binary-13.22 {Tcl_BinaryObjCmd: format float -Inf} bigEndian {
+ binary format f -Inf
+} \xFF\x80\x00\x00
+test binary-13.23 {Tcl_BinaryObjCmd: format float -Inf} littleEndian {
+ binary format f -Inf
+} \x00\x00\x80\xFF
test binary-14.1 {Tcl_BinaryObjCmd: format} -returnCodes error -body {
binary format d
@@ -767,7 +779,7 @@ test binary-21.13 {Tcl_BinaryObjCmd: scan} -setup {
} -body {
list [binary scan "abc def \x00 " C* arg1] $arg1
} -result {1 {abc def }}
-test binary-21.12 {Tcl_BinaryObjCmd: scan} -setup {
+test binary-21.14 {Tcl_BinaryObjCmd: scan} -setup {
unset -nocomplain arg1
} -body {
list [binary scan "abc def \x00ghi" C* arg1] $arg1
@@ -1975,10 +1987,10 @@ test binary-53.11 {Tcl_BinaryObjCmd: format} {} {
} \xCD\xCC\xCC\x3F\x9A\x99\x59\x40
test binary-53.12 {Tcl_BinaryObjCmd: float overflow} {} {
binary format R -3.402825e+38
-} \xFF\x7F\xFF\xFF
+} \xFF\x80\x00\x00
test binary-53.13 {Tcl_BinaryObjCmd: float overflow} {} {
binary format r -3.402825e+38
-} \xFF\xFF\x7F\xFF
+} \x00\x00\x80\xFF
test binary-53.14 {Tcl_BinaryObjCmd: float underflow} {} {
binary format R -3.402825e-100
} \x80\x00\x00\x00
@@ -2000,6 +2012,39 @@ test binary-53.19 {Tcl_BinaryObjCmd: format} {} {
set a {1.6 3.4}
binary format r1 $a
} \xCD\xCC\xCC\x3F
+test binary-53.20 {Tcl_BinaryObjCmd: float Inf} {} {
+ binary format R Inf
+} \x7f\x80\x00\x00
+test binary-53.21 {Tcl_BinaryObjCmd: float Inf} {} {
+ binary format r Inf
+} \x00\x00\x80\x7f
+test binary-53.22 {Binary float Inf round trip} -body {
+ binary scan [binary format R Inf] R inf
+ binary scan [binary format R -Inf] R inf_
+ list $inf $inf_
+} -result {Inf -Inf}
+test binary-53.23 {Binary float round to FLT_MAX} -body {
+ binary scan [binary format H* 7f7fffff] R fltmax
+ binary scan [binary format H* 47effffff0000000] Q round_to_fltmax
+ binary scan [binary format R $round_to_fltmax] R fltmax1
+ expr {$fltmax eq $fltmax1}
+} -result 1
+test binary-53.24 {Binary float round to -FLT_MAX} -body {
+ binary scan [binary format H* ff7fffff] R fltmax
+ binary scan [binary format H* c7effffff0000000] Q round_to_fltmax
+ binary scan [binary format R $round_to_fltmax] R fltmax1
+ expr {$fltmax eq $fltmax1}
+} -result 1
+test binary-53.25 {Binary float round to Inf} -body {
+ binary scan [binary format H* 47effffff0000001] Q round_to_inf
+ binary scan [binary format R $round_to_inf] R inf1
+ expr {$inf1 eq Inf}
+} -result 1
+test binary-53.26 {Binary float round to -Inf} -body {
+ binary scan [binary format H* c7effffff0000001] Q round_to_inf
+ binary scan [binary format R $round_to_inf] R inf1
+ expr {$inf1 eq -Inf}
+} -result 1
# scan t (s)
test binary-54.1 {Tcl_BinaryObjCmd: scan} -returnCodes error -body {
@@ -2396,11 +2441,27 @@ test binary-62.4 {infinity} ieeeFloatingPoint {
format 0x%016lx $w
} 0xfff0000000000000
test binary-62.5 {infinity} ieeeFloatingPoint {
- binary scan [binary format w 0x7ff0000000000000] q d
+ binary scan [binary format w 0x7FF0000000000000] q d
set d
} Inf
test binary-62.6 {infinity} ieeeFloatingPoint {
- binary scan [binary format w 0xfff0000000000000] q d
+ binary scan [binary format w 0xFFF0000000000000] q d
+ set d
+} -Inf
+test binary-62.7 {infinity} ieeeFloatingPoint {
+ binary scan [binary format r Inf] iu i
+ format 0x%08x $i
+} 0x7f800000
+test binary-62.8 {infinity} ieeeFloatingPoint {
+ binary scan [binary format r -Inf] iu i
+ format 0x%08x $i
+} 0xff800000
+test binary-62.9 {infinity} ieeeFloatingPoint {
+ binary scan [binary format i 0x7F800000] r d
+ set d
+} Inf
+test binary-62.10 {infinity} ieeeFloatingPoint {
+ binary scan [binary format i 0xFF800000] r d
set d
} -Inf
@@ -2408,19 +2469,19 @@ test binary-62.6 {infinity} ieeeFloatingPoint {
test binary-63.1 {NaN} ieeeFloatingPoint {
binary scan [binary format q NaN] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0x7ff0000000000000
test binary-63.2 {NaN} ieeeFloatingPoint {
binary scan [binary format q -NaN] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0xfff0000000000000
test binary-63.3 {NaN} ieeeFloatingPoint {
binary scan [binary format q NaN(3123456789aBc)] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0x7ff3123456789abc
test binary-63.4 {NaN} ieeeFloatingPoint {
binary scan [binary format q {NaN( 3123456789aBc)}] w w
- format 0x%016lx [expr {$w & 0xfff3ffffffffffff}]
+ format 0x%016lx [expr {$w & 0xFFF3FFFFFFFFFFFF}]
} 0x7ff3123456789abc
# Make sure TclParseNumber() rejects invalid nan-hex formats [Bug 3402540]
diff --git a/tests/chan.test b/tests/chan.test
index 4155c36..946e424 100644
--- a/tests/chan.test
+++ b/tests/chan.test
@@ -12,6 +12,8 @@ if {"::tcltest" ni [namespace children]} {
namespace import -force ::tcltest::*
}
+package require tcltests
+
#
# Note: The tests for the chan methods "create" and "postevent"
# currently reside in the file "ioCmd.test".
@@ -49,19 +51,19 @@ test chan-4.1 {chan command: configure subcommand} -body {
} -returnCodes error -result "wrong # args: should be \"chan configure channelId ?-option value ...?\""
test chan-4.2 {chan command: [Bug 800753]} -body {
chan configure stdout -eofchar Ā
-} -returnCodes error -match glob -result {bad value*}
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character}
test chan-4.3 {chan command: [Bug 800753]} -body {
chan configure stdout -eofchar \x00
-} -returnCodes error -match glob -result {bad value*}
-test chan-4.4 {chan command: check valid inValue, no outValue} -body {
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character}
+test chan-4.4 {chan command: check valid inValue, no outValue} -constraints deprecated -body {
chan configure stdout -eofchar [list \x27 {}]
} -result {}
test chan-4.5 {chan command: check valid inValue, invalid outValue} -body {
chan configure stdout -eofchar [list \x27 \x80]
-} -returnCodes error -match glob -result {bad value for -eofchar:*}
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character}
test chan-4.6 {chan command: check no inValue, valid outValue} -body {
chan configure stdout -eofchar [list {} \x27]
-} -result {} -cleanup {chan configure stdout -eofchar [list {} {}]}
+} -returnCodes error -result {bad value for -eofchar: must be non-NUL ASCII character} -cleanup {chan configure stdout -eofchar {}}
test chan-5.1 {chan command: copy subcommand} -body {
chan copy foo
diff --git a/tests/chanio.test b/tests/chanio.test
index c1085f4..41c0ef7 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -1889,13 +1889,13 @@ test chan-io-20.2 {Tcl_CreateChannel: initial settings} -constraints {win} -body
list [chan configure $f -eofchar] [chan configure $f -translation]
} -cleanup {
chan close $f
-} -result [list [list \x1A ""] {auto crlf}]
+} -result {{} {auto crlf}}
test chan-io-20.3 {Tcl_CreateChannel: initial settings} -constraints {unix} -body {
set f [open $path(test1) w+]
list [chan configure $f -eofchar] [chan configure $f -translation]
} -cleanup {
chan close $f
-} -result {{{} {}} {auto lf}}
+} -result {{} {auto lf}}
test chan-io-20.5 {Tcl_CreateChannel: install channel in empty slot} -setup {
set path(stdout) [makeFile {} stdout]
} -constraints {stdio notWinCI} -body {
@@ -4657,7 +4657,7 @@ test chan-io-35.6 {Tcl_Eof, eof char, lf write, auto read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.7 {Tcl_Eof, eof char, lf write, lf read} -setup {
file delete $path(test1)
} -body {
@@ -4671,7 +4671,7 @@ test chan-io-35.7 {Tcl_Eof, eof char, lf write, lf read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.8 {Tcl_Eof, eof char, cr write, auto read} -setup {
file delete $path(test1)
} -body {
@@ -4685,7 +4685,7 @@ test chan-io-35.8 {Tcl_Eof, eof char, cr write, auto read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.9 {Tcl_Eof, eof char, cr write, cr read} -setup {
file delete $path(test1)
} -body {
@@ -4699,7 +4699,7 @@ test chan-io-35.9 {Tcl_Eof, eof char, cr write, cr read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {9 8 1}
+} -result {8 8 1}
test chan-io-35.10 {Tcl_Eof, eof char, crlf write, auto read} -setup {
file delete $path(test1)
} -body {
@@ -4713,7 +4713,7 @@ test chan-io-35.10 {Tcl_Eof, eof char, crlf write, auto read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {11 8 1}
+} -result {10 8 1}
test chan-io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} -setup {
file delete $path(test1)
} -body {
@@ -4727,7 +4727,7 @@ test chan-io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} -setup {
list $s [string length [chan read $f]] [chan eof $f]
} -cleanup {
chan close $f
-} -result {11 8 1}
+} -result {10 8 1}
test chan-io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} -setup {
file delete $path(test1)
} -body {
@@ -5285,29 +5285,29 @@ test chan-io-39.21 {Tcl_SetChannelOption, setting read mode independently} \
test chan-io-39.22 {Tcl_SetChannelOption, invariance} -setup {
file delete $path(test1)
set l ""
-} -constraints {unix} -body {
+} -constraints {unix deprecated} -body {
set f1 [open $path(test1) w+]
lappend l [chan configure $f1 -eofchar]
- chan configure $f1 -eofchar {ON GO}
+ chan configure $f1 -eofchar {O {}}
lappend l [chan configure $f1 -eofchar]
chan configure $f1 -eofchar D
lappend l [chan configure $f1 -eofchar]
} -cleanup {
chan close $f1
-} -result {{{} {}} {O G} {D D}}
+} -result {{} O D}
test chan-io-39.22a {Tcl_SetChannelOption, invariance} -setup {
file delete $path(test1)
set l [list]
-} -body {
+} -constraints deprecated -body {
set f1 [open $path(test1) w+]
- chan configure $f1 -eofchar {ON GO}
+ chan configure $f1 -eofchar {O {}}
lappend l [chan configure $f1 -eofchar]
chan configure $f1 -eofchar D
lappend l [chan configure $f1 -eofchar]
lappend l [list [catch {chan configure $f1 -eofchar {1 2 3}} msg] $msg]
} -cleanup {
chan close $f1
-} -result {{O G} {D D} {1 {bad value for -eofchar: should be a list of zero, one, or two elements}}}
+} -result {O D {1 {bad value for -eofchar: must be non-NUL ASCII character}}}
test chan-io-39.23 {Tcl_GetChannelOption, server socket is not readable or\
writeable, it should still have valid -eofchar and -translation options} -setup {
set l [list]
@@ -5317,7 +5317,7 @@ test chan-io-39.23 {Tcl_GetChannelOption, server socket is not readable or\
[chan configure $sock -translation]
} -cleanup {
chan close $sock
-} -result {{{}} auto}
+} -result {{} auto}
test chan-io-39.24 {Tcl_SetChannelOption, server socket is not readable or\
writable so we can't change -eofchar or -translation} -setup {
set l [list]
@@ -5328,7 +5328,7 @@ test chan-io-39.24 {Tcl_SetChannelOption, server socket is not readable or\
[chan configure $sock -translation]
} -cleanup {
chan close $sock
-} -result {{{}} auto}
+} -result {{} auto}
test chan-io-40.1 {POSIX open access modes: RDWR} -setup {
file delete $path(test3)
diff --git a/tests/encoding.test b/tests/encoding.test
index 1b13318..49570d3 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -844,6 +844,17 @@ runtests
}
+test encoding-29.0 {get encoding nul terminator lengths} -constraints {
+ testencoding
+} -body {
+ list \
+ [testencoding nullength ascii] \
+ [testencoding nullength utf-16] \
+ [testencoding nullength utf-32] \
+ [testencoding nullength gb12345] \
+ [testencoding nullength ksc5601]
+} -result {1 2 4 2 2}
+
# cleanup
namespace delete ::tcl::test::encoding
::tcltest::cleanupTests
diff --git a/tests/env.test b/tests/env.test
index dcf5ab4..bbf7985 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -106,8 +106,8 @@ variable keep {
__CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM
CommonProgramFiles CommonProgramFiles(x86) ProgramFiles
ProgramFiles(x86) CommonProgramW6432 ProgramW6432
- WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR PROCESSOR_ARCHITECTURE
- USERPROFILE
+ PROCESSOR_ARCHITECTURE PROCESSOR_ARCHITEW6432 USERPROFILE
+ WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR
}
variable printenvScript [makeFile [string map [list @keep@ [list $keep]] {
diff --git a/tests/http.test b/tests/http.test
index 11bf0f9..3c2f4d8 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -46,6 +46,7 @@ if {![file exists $httpdFile]} {
catch {package require Thread 2.7-}
if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} {
set httpthread [thread::create -preserved]
+ lappend threadStack [list thread::release $httpthread]
thread::send $httpthread [list source $httpdFile]
thread::send $httpthread [list set bindata $bindata]
thread::send $httpthread {httpd_init 0; set port} port
@@ -63,6 +64,7 @@ if {[catch {package present Thread}] == 0 && [file exists $httpdFile]} {
catch {unset port}
return
}
+ set threadStack {}
}
if {![info exists ThreadLevel]} {
@@ -77,6 +79,9 @@ if {![info exists ThreadLevel]} {
foreach ThreadLevel $ValueRange {
source [info script]
}
+ if {[llength $threadStack]} {
+ eval [lpop threadStack]
+ }
catch {unset ThreadLevel}
catch {unset ValueRange}
return
@@ -85,17 +90,17 @@ if {![info exists ThreadLevel]} {
catch {puts "==== Test with ThreadLevel $ThreadLevel ===="}
http::config -threadlevel $ThreadLevel
-test http-1.1 {http::config} {
+test http-1.1.$ThreadLevel {http::config} {
http::config -useragent UserAgent
http::config
-} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyfilter http::ProxyRequired -proxyhost {} -proxyport {} -repost 0 -threadlevel $ThreadLevel -urlencoding utf-8 -useragent UserAgent -zip 1]
-test http-1.2 {http::config} {
+} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyauth {} -proxyfilter http::ProxyRequired -proxyhost {} -proxynot {} -proxyport {} -repost 0 -threadlevel $ThreadLevel -urlencoding utf-8 -useragent UserAgent -zip 1]
+test http-1.2.$ThreadLevel {http::config} {
http::config -proxyfilter
} http::ProxyRequired
-test http-1.3 {http::config} {
+test http-1.3.$ThreadLevel {http::config} {
catch {http::config -junk}
} 1
-test http-1.4 {http::config} {
+test http-1.4.$ThreadLevel {http::config} {
set savedconf [http::config]
http::config -proxyhost nowhere.come -proxyport 8080 \
-proxyfilter myFilter -useragent "Tcl Test Suite" \
@@ -103,11 +108,11 @@ test http-1.4 {http::config} {
set x [http::config]
http::config {*}$savedconf
set x
-} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyfilter myFilter -proxyhost nowhere.come -proxyport 8080 -repost 0 -threadlevel $ThreadLevel -urlencoding iso8859-1 -useragent {Tcl Test Suite} -zip 1]
-test http-1.5 {http::config} -returnCodes error -body {
+} [list -accept */* -cookiejar {} -pipeline 1 -postfresh 0 -proxyauth {} -proxyfilter myFilter -proxyhost nowhere.come -proxynot {} -proxyport 8080 -repost 0 -threadlevel $ThreadLevel -urlencoding iso8859-1 -useragent {Tcl Test Suite} -zip 1]
+test http-1.5.$ThreadLevel {http::config} -returnCodes error -body {
http::config -proxyhost {} -junk 8080
-} -result {Unknown option -junk, must be: -accept, -cookiejar, -pipeline, -postfresh, -proxyfilter, -proxyhost, -proxyport, -repost, -threadlevel, -urlencoding, -useragent, -zip}
-test http-1.6 {http::config} -setup {
+} -result {Unknown option -junk, must be: -accept, -cookiejar, -pipeline, -postfresh, -proxyauth, -proxyfilter, -proxyhost, -proxynot, -proxyport, -repost, -threadlevel, -urlencoding, -useragent, -zip}
+test http-1.6.$ThreadLevel {http::config} -setup {
set oldenc [http::config -urlencoding]
} -body {
set enc [list [http::config -urlencoding]]
@@ -117,42 +122,42 @@ test http-1.6 {http::config} -setup {
http::config -urlencoding $oldenc
} -result {utf-8 iso8859-1}
-test http-2.1 {http::reset} {
+test http-2.1.$ThreadLevel {http::reset} {
catch {http::reset http#1}
} 0
-test http-2.2 {http::CharsetToEncoding} {
+test http-2.2.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding iso-8859-11
} iso8859-11
-test http-2.3 {http::CharsetToEncoding} {
+test http-2.3.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding iso-2022-kr
} iso2022-kr
-test http-2.4 {http::CharsetToEncoding} {
+test http-2.4.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding shift-jis
} shiftjis
-test http-2.5 {http::CharsetToEncoding} {
+test http-2.5.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding windows-437
} cp437
-test http-2.6 {http::CharsetToEncoding} {
+test http-2.6.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding latin5
} iso8859-9
-test http-2.7 {http::CharsetToEncoding} {
+test http-2.7.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding latin1
} iso8859-1
-test http-2.8 {http::CharsetToEncoding} {
+test http-2.8.$ThreadLevel {http::CharsetToEncoding} {
http::CharsetToEncoding latin4
} binary
-test http-3.1 {http::geturl} -returnCodes error -body {
+test http-3.1.$ThreadLevel {http::geturl} -returnCodes error -body {
http::geturl -bogus flag
} -result {Unknown option flag, can be: -binary, -blocksize, -channel, -command, -guesstype, -handler, -headers, -keepalive, -method, -myaddr, -progress, -protocol, -query, -queryblocksize, -querychannel, -queryprogress, -strict, -timeout, -type, -validate}
-test http-3.2 {http::geturl} -returnCodes error -body {
+test http-3.2.$ThreadLevel {http::geturl} -returnCodes error -body {
http::geturl http:junk
} -result {Unsupported URL: http:junk}
set url //${::HOST}:$port
set badurl //${::HOST}:[expr {$port+1}]
-test http-3.3 {http::geturl} -body {
+test http-3.3.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url]
http::data $token
} -cleanup {
@@ -172,7 +177,7 @@ set badposturl //${::HOST}:$port/droppost
set authorityurl //${::HOST}:$port
set ipv6url http://\[::1\]:$port/
-test http-3.4 {http::geturl} -body {
+test http-3.4.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url]
http::data $token
} -cleanup {
@@ -185,7 +190,7 @@ proc selfproxy {host} {
global port
return [list ${::HOST} $port]
}
-test http-3.5 {http::geturl} -body {
+test http-3.5.$ThreadLevel {http::geturl} -body {
http::config -proxyfilter selfproxy
set token [http::geturl $url]
http::data $token
@@ -196,7 +201,7 @@ test http-3.5 {http::geturl} -body {
<h1>Hello, World!</h1>
<h2>GET http:$url</h2>
</body></html>"
-test http-3.6 {http::geturl} -body {
+test http-3.6.$ThreadLevel {http::geturl} -body {
http::config -proxyfilter bogus
set token [http::geturl $url]
http::data $token
@@ -207,7 +212,7 @@ test http-3.6 {http::geturl} -body {
<h1>Hello, World!</h1>
<h2>GET $tail</h2>
</body></html>"
-test http-3.7 {http::geturl} -body {
+test http-3.7.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url -headers {Pragma no-cache}]
http::data $token
} -cleanup {
@@ -216,7 +221,7 @@ test http-3.7 {http::geturl} -body {
<h1>Hello, World!</h1>
<h2>GET $tail</h2>
</body></html>"
-test http-3.8 {http::geturl} -body {
+test http-3.8.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url -query Name=Value&Foo=Bar -timeout 3000]
http::data $token
} -cleanup {
@@ -230,13 +235,13 @@ test http-3.8 {http::geturl} -body {
<dt>Foo<dd>Bar
</dl>
</body></html>"
-test http-3.9 {http::geturl} -body {
+test http-3.9.$ThreadLevel {http::geturl} -body {
set token [http::geturl $url -validate 1]
http::code $token
} -cleanup {
http::cleanup $token
} -result "HTTP/1.0 200 OK"
-test http-3.10 {http::geturl queryprogress} -setup {
+test http-3.10.$ThreadLevel {http::geturl queryprogress} -setup {
set query foo=bar
set sep ""
set i 0
@@ -259,7 +264,7 @@ test http-3.10 {http::geturl queryprogress} -setup {
} -cleanup {
http::cleanup $t
} -result {ok 122879 {16384 32768 49152 65536 81920 98304 114688 122879} {Got 122879 bytes}}
-test http-3.11 {http::geturl querychannel with -command} -setup {
+test http-3.11.$ThreadLevel {http::geturl querychannel with -command} -setup {
set query foo=bar
set sep ""
set i 0
@@ -298,7 +303,7 @@ test http-3.11 {http::geturl querychannel with -command} -setup {
# The status is "eof".
# On Windows, the http::wait procedure gets a "connection reset by peer" error
# while reading the reply.
-test http-3.12 {http::geturl querychannel with aborted request} -setup {
+test http-3.12.$ThreadLevel {http::geturl querychannel with aborted request} -setup {
set query foo=bar
set sep ""
set i 0
@@ -336,7 +341,7 @@ test http-3.12 {http::geturl querychannel with aborted request} -setup {
removeFile outdata
http::cleanup $t
} -result {ok {HTTP/1.0 200 Data follows}}
-test http-3.13 {http::geturl socket leak test} {
+test http-3.13.$ThreadLevel {http::geturl socket leak test} {
set chanCount [llength [file channels]]
for {set i 0} {$i < 3} {incr i} {
catch {http::geturl $badurl -timeout 5000}
@@ -344,43 +349,43 @@ test http-3.13 {http::geturl socket leak test} {
# No extra channels should be taken
expr {[llength [file channels]] == $chanCount}
} 1
-test http-3.14 "http::geturl $fullurl" -body {
+test http-3.14.$ThreadLevel "http::geturl $fullurl" -body {
set token [http::geturl $fullurl -validate 1]
http::code $token
} -cleanup {
http::cleanup $token
} -result "HTTP/1.0 200 OK"
-test http-3.15 {http::geturl parse failures} -body {
+test http-3.15.$ThreadLevel {http::geturl parse failures} -body {
http::geturl "{invalid}:url"
} -returnCodes error -result {Unsupported URL: {invalid}:url}
-test http-3.16 {http::geturl parse failures} -body {
+test http-3.16.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http:relative/url
} -returnCodes error -result {Unsupported URL: http:relative/url}
-test http-3.17 {http::geturl parse failures} -body {
+test http-3.17.$ThreadLevel {http::geturl parse failures} -body {
http::geturl /absolute/url
} -returnCodes error -result {Missing host part: /absolute/url}
-test http-3.18 {http::geturl parse failures} -body {
+test http-3.18.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere:123456789/
} -returnCodes error -result {Invalid port number: 123456789}
-test http-3.19 {http::geturl parse failures} -body {
+test http-3.19.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://{user}@somewhere
} -returnCodes error -result {Illegal characters in URL user}
-test http-3.20 {http::geturl parse failures} -body {
+test http-3.20.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://%user@somewhere
} -returnCodes error -result {Illegal encoding character usage "%us" in URL user}
-test http-3.21 {http::geturl parse failures} -body {
+test http-3.21.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/{path}
} -returnCodes error -result {Illegal characters in URL path}
-test http-3.22 {http::geturl parse failures} -body {
+test http-3.22.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/%path
} -returnCodes error -result {Illegal encoding character usage "%pa" in URL path}
-test http-3.23 {http::geturl parse failures} -body {
+test http-3.23.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/path?{query}?
} -returnCodes error -result {Illegal characters in URL path}
-test http-3.24 {http::geturl parse failures} -body {
+test http-3.24.$ThreadLevel {http::geturl parse failures} -body {
http::geturl http://somewhere/path?%query
} -returnCodes error -result {Illegal encoding character usage "%qu" in URL path}
-test http-3.25 {http::meta} -setup {
+test http-3.25.$ThreadLevel {http::meta} -setup {
unset -nocomplain m token
} -body {
set token [http::geturl $url -timeout 3000]
@@ -390,7 +395,7 @@ test http-3.25 {http::meta} -setup {
http::cleanup $token
unset -nocomplain m token
} -result {content-length content-type date}
-test http-3.26 {http::meta} -setup {
+test http-3.26.$ThreadLevel {http::meta} -setup {
unset -nocomplain m token
} -body {
set token [http::geturl $url -headers {X-Check 1} -timeout 3000]
@@ -400,7 +405,7 @@ test http-3.26 {http::meta} -setup {
http::cleanup $token
unset -nocomplain m token
} -result {content-length content-type date x-check}
-test http-3.27 {http::geturl: -headers override -type} -body {
+test http-3.27.$ThreadLevel {http::geturl: -headers override -type} -body {
set token [http::geturl $url/headers -type "text/plain" -query dummy \
-headers [list "Content-Type" "text/plain;charset=utf-8"]]
http::data $token
@@ -413,7 +418,7 @@ Accept \*/\*
Accept-Encoding .*
Connection close
Content-Length 5}
-test http-3.28 {http::geturl: -headers override -type default} -body {
+test http-3.28.$ThreadLevel {http::geturl: -headers override -type default} -body {
set token [http::geturl $url/headers -query dummy \
-headers [list "Content-Type" "text/plain;charset=utf-8"]]
http::data $token
@@ -426,7 +431,7 @@ Accept \*/\*
Accept-Encoding .*
Connection close
Content-Length 5}
-test http-3.29 {http::geturl IPv6 address} -body {
+test http-3.29.$ThreadLevel {http::geturl IPv6 address} -body {
# We only want to see if the URL gets parsed correctly. This is
# the case if http::geturl succeeds or returns a socket related
# error. If the parsing is wrong, we'll get a parse error.
@@ -440,20 +445,20 @@ test http-3.29 {http::geturl IPv6 address} -body {
} -cleanup {
catch { http::cleanup $token }
} -result 0
-test http-3.30 {http::geturl query without path} -body {
+test http-3.30.$ThreadLevel {http::geturl query without path} -body {
set token [http::geturl $authorityurl?var=val]
http::ncode $token
} -cleanup {
catch { http::cleanup $token }
} -result 200
-test http-3.31 {http::geturl fragment without path} -body {
+test http-3.31.$ThreadLevel {http::geturl fragment without path} -body {
set token [http::geturl "$authorityurl#fragment42"]
http::ncode $token
} -cleanup {
catch { http::cleanup $token }
} -result 200
# Bug c11a51c482
-test http-3.32 {http::geturl: -headers override -accept default} -body {
+test http-3.32.$ThreadLevel {http::geturl: -headers override -accept default} -body {
set token [http::geturl $url/headers -query dummy \
-headers [list "Accept" "text/plain,application/tcl-test-value"]]
http::data $token
@@ -467,20 +472,20 @@ Connection close
Content-Type application/x-www-form-urlencoded
Content-Length 5}
# Bug 838e99a76d
-test http-3.33 {http::geturl application/xml is text} -body {
+test http-3.33.$ThreadLevel {http::geturl application/xml is text} -body {
set token [http::geturl "$xmlurl"]
scan [http::data $token] "<%\[^>]>%c<%\[^>]>"
} -cleanup {
catch { http::cleanup $token }
} -result {test 4660 /test}
-test http-3.34 {http::geturl -headers not a list} -returnCodes error -body {
+test http-3.34.$ThreadLevel {http::geturl -headers not a list} -returnCodes error -body {
http::geturl http://test/t -headers \"
} -result {Bad value for -headers ("), must be list}
-test http-3.35 {http::geturl -headers not even number of elements} -returnCodes error -body {
+test http-3.35.$ThreadLevel {http::geturl -headers not even number of elements} -returnCodes error -body {
http::geturl http://test/t -headers {List Length 3}
} -result {Bad value for -headers (List Length 3), number of list elements must be even}
-test http-4.1 {http::Event} -body {
+test http-4.1.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -keepalive 0]
upvar #0 $token data
array set meta $data(meta)
@@ -488,7 +493,7 @@ test http-4.1 {http::Event} -body {
} -cleanup {
http::cleanup $token
} -result 1
-test http-4.2 {http::Event} -body {
+test http-4.2.$ThreadLevel {http::Event} -body {
set token [http::geturl $url]
upvar #0 $token data
array set meta $data(meta)
@@ -496,13 +501,13 @@ test http-4.2 {http::Event} -body {
} -cleanup {
http::cleanup $token
} -result 0
-test http-4.3 {http::Event} -body {
+test http-4.3.$ThreadLevel {http::Event} -body {
set token [http::geturl $url]
http::code $token
} -cleanup {
http::cleanup $token
} -result {HTTP/1.0 200 Data follows}
-test http-4.4 {http::Event} -setup {
+test http-4.4.$ThreadLevel {http::Event} -setup {
set testfile [makeFile "" testfile]
} -body {
set out [open $testfile w]
@@ -519,7 +524,7 @@ test http-4.4 {http::Event} -setup {
<h1>Hello, World!</h1>
<h2>GET $tail</h2>
</body></html>"
-test http-4.5 {http::Event} -setup {
+test http-4.5.$ThreadLevel {http::Event} -setup {
set testfile [makeFile "" testfile]
} -body {
set out [open $testfile w]
@@ -532,7 +537,7 @@ test http-4.5 {http::Event} -setup {
removeFile $testfile
http::cleanup $token
} -result 1
-test http-4.6 {http::Event} -setup {
+test http-4.6.$ThreadLevel {http::Event} -setup {
set testfile [makeFile "" testfile]
} -body {
set out [open $testfile w]
@@ -554,29 +559,29 @@ proc myProgress {token total current} {
}
set progress [list $total $current]
}
-test http-4.6.1 {http::Event} knownBug {
+test http-4.6.1.$ThreadLevel {http::Event} knownBug {
set token [http::geturl $url -blocksize 50 -progress myProgress]
return $progress
} {111 111}
-test http-4.7 {http::Event} -body {
+test http-4.7.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -keepalive 0 -progress myProgress]
return $progress
} -cleanup {
http::cleanup $token
} -result {111 111}
-test http-4.8 {http::Event} -body {
+test http-4.8.$ThreadLevel {http::Event} -body {
set token [http::geturl $url]
http::status $token
} -cleanup {
http::cleanup $token
} -result {ok}
-test http-4.9 {http::Event} -body {
+test http-4.9.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -progress myProgress]
http::code $token
} -cleanup {
http::cleanup $token
} -result {HTTP/1.0 200 Data follows}
-test http-4.10 {http::Event} -body {
+test http-4.10.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -progress myProgress]
http::size $token
} -cleanup {
@@ -586,7 +591,7 @@ test http-4.10 {http::Event} -body {
# Timeout cases
# Short timeout to working server (the test server). This lets us try a
# reset during the connection.
-test http-4.11 {http::Event} -body {
+test http-4.11.$ThreadLevel {http::Event} -body {
set token [http::geturl $url -timeout 1 -keepalive 0 -command \#]
http::reset $token
http::status $token
@@ -595,7 +600,7 @@ test http-4.11 {http::Event} -body {
} -result {reset}
# Longer timeout with reset.
-test http-4.12 {http::Event} -body {
+test http-4.12.$ThreadLevel {http::Event} -body {
set token [http::geturl $url/?timeout=10 -keepalive 0 -command \#]
http::reset $token
http::status $token
@@ -605,7 +610,7 @@ test http-4.12 {http::Event} -body {
# Medium timeout to working server that waits even longer. The timeout
# hits while waiting for a reply.
-test http-4.13 {http::Event} -body {
+test http-4.13.$ThreadLevel {http::Event} -body {
set token [http::geturl $url?timeout=30 -keepalive 0 -timeout 10 -command \#]
http::wait $token
http::status $token
@@ -615,7 +620,7 @@ test http-4.13 {http::Event} -body {
# Longer timeout to good host, bad port, gets an error after the
# connection "completes" but the socket is bad.
-test http-4.14 {http::Event} -body {
+test http-4.14.$ThreadLevel {http::Event} -body {
set token [http::geturl $badurl/?timeout=10 -timeout 10000 -command \#]
if {$token eq ""} {
error "bogus return from http::geturl"
@@ -627,10 +632,13 @@ test http-4.14 {http::Event} -body {
} -result {connect failed connection refused}
# Bogus host
-test http-4.15 {http::Event} -body {
+test http-4.15.$ThreadLevel {http::Event} -body {
# This test may fail if you use a proxy server. That is to be
# expected and is not a problem with Tcl.
- set token [http::geturl //not_a_host.tcl.tk -timeout 3000 -command \#]
+ # With http::config -threadlevel 1 or 2, the script enters the event loop
+ # during the DNS lookup, and has the opportunity to time out.
+ # Increase -timeout from 3000 to 10000 to prevent this.
+ set token [http::geturl //not_a_host.tcl.tk -timeout 10000 -command \#]
http::wait $token
set result "[http::status $token] -- [lindex [http::error $token] 0]"
# error codes vary among platforms.
@@ -638,7 +646,7 @@ test http-4.15 {http::Event} -body {
catch {http::cleanup $token}
} -match glob -result "error -- couldn't open socket*"
-test http-4.16 {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup {
+test http-4.16.$ThreadLevel {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup {
proc list-difference {l1 l2} {
lmap item $l2 {if {$item in $l1} continue; set item}
}
@@ -653,17 +661,17 @@ test http-4.16 {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup {
rename list-difference {}
} -result {}
-test http-5.1 {http::formatQuery} {
+test http-5.1.$ThreadLevel {http::formatQuery} {
http::formatQuery name1 value1 name2 "value two"
} {name1=value1&name2=value%20two}
# test http-5.2 obsoleted by 5.4 and 5.5 with http 2.5
-test http-5.3 {http::formatQuery} {
+test http-5.3.$ThreadLevel {http::formatQuery} {
http::formatQuery lines "line1\nline2\nline3"
} {lines=line1%0D%0Aline2%0D%0Aline3}
-test http-5.4 {http::formatQuery} {
+test http-5.4.$ThreadLevel {http::formatQuery} {
http::formatQuery name1 ~bwelch name2 ¡¢¢
} {name1=~bwelch&name2=%C2%A1%C2%A2%C2%A2}
-test http-5.5 {http::formatQuery} {
+test http-5.5.$ThreadLevel {http::formatQuery} {
set enc [http::config -urlencoding]
http::config -urlencoding iso8859-1
set res [http::formatQuery name1 ~bwelch name2 ¡¢¢]
@@ -671,7 +679,7 @@ test http-5.5 {http::formatQuery} {
set res
} {name1=~bwelch&name2=%A1%A2%A2}
-test http-6.1 {http::ProxyRequired} -body {
+test http-6.1.$ThreadLevel {http::ProxyRequired} -body {
http::config -proxyhost ${::HOST} -proxyport $port
set token [http::geturl $url]
http::wait $token
@@ -685,15 +693,15 @@ test http-6.1 {http::ProxyRequired} -body {
<h2>GET http:$url</h2>
</body></html>"
-test http-7.1 {http::mapReply} {
+test http-7.1.$ThreadLevel {http::mapReply} {
http::mapReply "abc\$\[\]\"\\()\}\{"
} {abc%24%5B%5D%22%5C%28%29%7D%7B}
-test http-7.2 {http::mapReply} {
+test http-7.2.$ThreadLevel {http::mapReply} {
# RFC 2718 specifies that we pass urlencoding on utf-8 chars by default,
# so make sure this gets converted to utf-8 then urlencoded.
http::mapReply "∈"
} {%E2%88%88}
-test http-7.3 {http::formatQuery} -setup {
+test http-7.3.$ThreadLevel {http::formatQuery} -setup {
set enc [http::config -urlencoding]
} -returnCodes error -body {
# -urlencoding "" no longer supported. Use "iso8859-1".
@@ -702,7 +710,7 @@ test http-7.3 {http::formatQuery} -setup {
} -cleanup {
http::config -urlencoding $enc
} -result {unknown encoding ""}
-test http-7.4 {http::formatQuery} -setup {
+test http-7.4.$ThreadLevel {http::formatQuery} -setup {
set enc [http::config -urlencoding]
} -body {
# this would be reverting to http <=2.4 behavior w/o errors
@@ -716,113 +724,113 @@ test http-7.4 {http::formatQuery} -setup {
package require tcl::idna 1.0
-test http-idna-1.1 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.1.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna
} -result {wrong # args: should be "::tcl::idna subcommand ?arg ...?"}
-test http-idna-1.2 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.2.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna ?
} -result {unknown or ambiguous subcommand "?": must be decode, encode, puny, or version}
-test http-idna-1.3 {IDNA package: basics} -body {
+test http-idna-1.3.$ThreadLevel {IDNA package: basics} -body {
::tcl::idna version
} -result 1.0.1
-test http-idna-1.4 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.4.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna version what
} -result {wrong # args: should be "::tcl::idna version"}
-test http-idna-1.5 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.5.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny
} -result {wrong # args: should be "::tcl::idna puny subcommand ?arg ...?"}
-test http-idna-1.6 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.6.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny ?
} -result {unknown or ambiguous subcommand "?": must be decode, or encode}
-test http-idna-1.7 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.7.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny encode
} -result {wrong # args: should be "::tcl::idna puny encode string ?case?"}
-test http-idna-1.8 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.8.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny encode a b c
} -result {wrong # args: should be "::tcl::idna puny encode string ?case?"}
-test http-idna-1.9 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.9.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny decode
} -result {wrong # args: should be "::tcl::idna puny decode string ?case?"}
-test http-idna-1.10 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.10.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna puny decode a b c
} -result {wrong # args: should be "::tcl::idna puny decode string ?case?"}
-test http-idna-1.11 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.11.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna decode
} -result {wrong # args: should be "::tcl::idna decode hostname"}
-test http-idna-1.12 {IDNA package: basics} -returnCodes error -body {
+test http-idna-1.12.$ThreadLevel {IDNA package: basics} -returnCodes error -body {
::tcl::idna encode
} -result {wrong # args: should be "::tcl::idna encode hostname"}
-test http-idna-2.1 {puny encode: functional test} {
+test http-idna-2.1.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode abc
} abc-
-test http-idna-2.2 {puny encode: functional test} {
+test http-idna-2.2.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode a€b€c
} abc-k50ab
-test http-idna-2.3 {puny encode: functional test} {
+test http-idna-2.3.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode ABC
} ABC-
-test http-idna-2.4 {puny encode: functional test} {
+test http-idna-2.4.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode A€B€C
} ABC-k50ab
-test http-idna-2.5 {puny encode: functional test} {
+test http-idna-2.5.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode ABC 0
} abc-
-test http-idna-2.6 {puny encode: functional test} {
+test http-idna-2.6.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode A€B€C 0
} abc-k50ab
-test http-idna-2.7 {puny encode: functional test} {
+test http-idna-2.7.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode ABC 1
} ABC-
-test http-idna-2.8 {puny encode: functional test} {
+test http-idna-2.8.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode A€B€C 1
} ABC-k50ab
-test http-idna-2.9 {puny encode: functional test} {
+test http-idna-2.9.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode abc 0
} abc-
-test http-idna-2.10 {puny encode: functional test} {
+test http-idna-2.10.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode a€b€c 0
} abc-k50ab
-test http-idna-2.11 {puny encode: functional test} {
+test http-idna-2.11.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode abc 1
} ABC-
-test http-idna-2.12 {puny encode: functional test} {
+test http-idna-2.12.$ThreadLevel {puny encode: functional test} {
::tcl::idna puny encode a€b€c 1
} ABC-k50ab
-test http-idna-2.13 {puny encode: edge cases} {
+test http-idna-2.13.$ThreadLevel {puny encode: edge cases} {
::tcl::idna puny encode ""
} ""
-test http-idna-2.14-A {puny encode: examples from RFC 3492} {
+test http-idna-2.14-A.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644
u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F
}]] ""]
} egbpdaj6bu4bxfgehfvwxn
-test http-idna-2.14-B {puny encode: examples from RFC 3492} {
+test http-idna-2.14-B.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587
}]] ""]
} ihqwcrb4cv8a8dqg056pqjye
-test http-idna-2.14-C {puny encode: examples from RFC 3492} {
+test http-idna-2.14-C.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587
}]] ""]
} ihqwctvzc91f659drss3x8bo0yb
-test http-idna-2.14-D {puny encode: examples from RFC 3492} {
+test http-idna-2.14-D.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074
u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D
u+0065 u+0073 u+006B u+0079
}]] ""]
} Proprostnemluvesky-uyb24dma41a
-test http-idna-2.14-E {puny encode: examples from RFC 3492} {
+test http-idna-2.14-E.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8
u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2
u+05D1 u+05E8 u+05D9 u+05EA
}]] ""]
} 4dbcagdahymbxekheh6e0a7fei0b
-test http-idna-2.14-F {puny encode: examples from RFC 3492} {
+test http-idna-2.14-F.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+092F u+0939 u+0932 u+094B u+0917 u+0939 u+093F u+0928 u+094D
u+0926 u+0940 u+0915 u+094D u+092F u+094B u+0902 u+0928 u+0939
@@ -830,20 +838,20 @@ test http-idna-2.14-F {puny encode: examples from RFC 3492} {
u+0939 u+0948 u+0902
}]] ""]
} i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd
-test http-idna-2.14-G {puny encode: examples from RFC 3492} {
+test http-idna-2.14-G.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092
u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B
}]] ""]
} n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa
-test http-idna-2.14-H {puny encode: examples from RFC 3492} {
+test http-idna-2.14-H.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+C138 u+ACC4 u+C758 u+BAA8 u+B4E0 u+C0AC u+B78C u+B4E4 u+C774
u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74
u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C
}]] ""]
} 989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c
-test http-idna-2.14-I {puny encode: examples from RFC 3492} {
+test http-idna-2.14-I.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E
u+043D u+0438 u+043D u+0435 u+0433 u+043E u+0432 u+043E u+0440
@@ -851,7 +859,7 @@ test http-idna-2.14-I {puny encode: examples from RFC 3492} {
u+0438
}]] ""]
} b1abfaaepdrnnbgefbadotcwatmq2g4l
-test http-idna-2.14-J {puny encode: examples from RFC 3492} {
+test http-idna-2.14-J.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0050 u+006F u+0072 u+0071 u+0075 u+00E9 u+006E u+006F u+0070
u+0075 u+0065 u+0064 u+0065 u+006E u+0073 u+0069 u+006D u+0070
@@ -860,7 +868,7 @@ test http-idna-2.14-J {puny encode: examples from RFC 3492} {
u+0061 u+00F1 u+006F u+006C
}]] ""]
} PorqunopuedensimplementehablarenEspaol-fmd56a
-test http-idna-2.14-K {puny encode: examples from RFC 3492} {
+test http-idna-2.14-K.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0054 u+1EA1 u+0069 u+0073 u+0061 u+006F u+0068 u+1ECD u+006B
u+0068 u+00F4 u+006E u+0067 u+0074 u+0068 u+1EC3 u+0063 u+0068
@@ -868,135 +876,135 @@ test http-idna-2.14-K {puny encode: examples from RFC 3492} {
u+0056 u+0069 u+1EC7 u+0074
}]] ""]
} TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g
-test http-idna-2.14-L {puny encode: examples from RFC 3492} {
+test http-idna-2.14-L.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F
}]] ""]
} 3B-ww4c5e180e575a65lsy2b
-test http-idna-2.14-M {puny encode: examples from RFC 3492} {
+test http-idna-2.14-M.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074
u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D
u+004F u+004E u+004B u+0045 u+0059 u+0053
}]] ""]
} -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n
-test http-idna-2.14-N {puny encode: examples from RFC 3492} {
+test http-idna-2.14-N.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F
u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D
u+305D u+308C u+305E u+308C u+306E u+5834 u+6240
}]] ""]
} Hello-Another-Way--fc4qua05auwb3674vfr0b
-test http-idna-2.14-O {puny encode: examples from RFC 3492} {
+test http-idna-2.14-O.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032
}]] ""]
} 2-u9tlzr9756bt3uc0v
-test http-idna-2.14-P {puny encode: examples from RFC 3492} {
+test http-idna-2.14-P.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059
u+308B u+0035 u+79D2 u+524D
}]] ""]
} MajiKoi5-783gue6qz075azm5e
-test http-idna-2.14-Q {puny encode: examples from RFC 3492} {
+test http-idna-2.14-Q.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0
}]] ""]
} de-jg4avhby1noc0d
-test http-idna-2.14-R {puny encode: examples from RFC 3492} {
+test http-idna-2.14-R.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode [join [subst [string map {u+ \\u} {
u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067
}]] ""]
} d9juau41awczczp
-test http-idna-2.14-S {puny encode: examples from RFC 3492} {
+test http-idna-2.14-S.$ThreadLevel {puny encode: examples from RFC 3492} {
::tcl::idna puny encode {-> $1.00 <-}
} {-> $1.00 <--}
-test http-idna-3.1 {puny decode: functional test} {
+test http-idna-3.1.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-
} abc
-test http-idna-3.2 {puny decode: functional test} {
+test http-idna-3.2.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-k50ab
} a€b€c
-test http-idna-3.3 {puny decode: functional test} {
+test http-idna-3.3.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-
} ABC
-test http-idna-3.4 {puny decode: functional test} {
+test http-idna-3.4.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-k50ab
} A€B€C
-test http-idna-3.5 {puny decode: functional test} {
+test http-idna-3.5.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-K50AB
} A€B€C
-test http-idna-3.6 {puny decode: functional test} {
+test http-idna-3.6.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-K50AB
} a€b€c
-test http-idna-3.7 {puny decode: functional test} {
+test http-idna-3.7.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC- 0
} abc
-test http-idna-3.8 {puny decode: functional test} {
+test http-idna-3.8.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-K50AB 0
} a€b€c
-test http-idna-3.9 {puny decode: functional test} {
+test http-idna-3.9.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC- 1
} ABC
-test http-idna-3.10 {puny decode: functional test} {
+test http-idna-3.10.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode ABC-K50AB 1
} A€B€C
-test http-idna-3.11 {puny decode: functional test} {
+test http-idna-3.11.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc- 0
} abc
-test http-idna-3.12 {puny decode: functional test} {
+test http-idna-3.12.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-k50ab 0
} a€b€c
-test http-idna-3.13 {puny decode: functional test} {
+test http-idna-3.13.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc- 1
} ABC
-test http-idna-3.14 {puny decode: functional test} {
+test http-idna-3.14.$ThreadLevel {puny decode: functional test} {
::tcl::idna puny decode abc-k50ab 1
} A€B€C
-test http-idna-3.15 {puny decode: edge cases and errors} {
+test http-idna-3.15.$ThreadLevel {puny decode: edge cases and errors} {
# Is this case actually correct?
binary encode hex [encoding convertto utf-8 [::tcl::idna puny decode abc]]
} c282c281c280
-test http-idna-3.16 {puny decode: edge cases and errors} -returnCodes error -body {
+test http-idna-3.16.$ThreadLevel {puny decode: edge cases and errors} -returnCodes error -body {
::tcl::idna puny decode abc!
} -result {bad decode character "!"}
-test http-idna-3.17 {puny decode: edge cases and errors} {
+test http-idna-3.17.$ThreadLevel {puny decode: edge cases and errors} {
catch {::tcl::idna puny decode abc!} -> opt
dict get $opt -errorcode
} {PUNYCODE BAD_INPUT CHAR}
-test http-idna-3.18 {puny decode: edge cases and errors} {
+test http-idna-3.18.$ThreadLevel {puny decode: edge cases and errors} {
::tcl::idna puny decode ""
} {}
# A helper so we don't get lots of crap in failures
proc hexify s {lmap c [split $s ""] {format u+%04X [scan $c %c]}}
-test http-idna-3.19-A {puny decode: examples from RFC 3492} {
+test http-idna-3.19-A.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode egbpdaj6bu4bxfgehfvwxn]
} [list {*}{
u+0644 u+064A u+0647 u+0645 u+0627 u+0628 u+062A u+0643 u+0644
u+0645 u+0648 u+0634 u+0639 u+0631 u+0628 u+064A u+061F
}]
-test http-idna-3.19-B {puny decode: examples from RFC 3492} {
+test http-idna-3.19-B.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode ihqwcrb4cv8a8dqg056pqjye]
} {u+4ED6 u+4EEC u+4E3A u+4EC0 u+4E48 u+4E0D u+8BF4 u+4E2D u+6587}
-test http-idna-3.19-C {puny decode: examples from RFC 3492} {
+test http-idna-3.19-C.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode ihqwctvzc91f659drss3x8bo0yb]
} {u+4ED6 u+5011 u+7232 u+4EC0 u+9EBD u+4E0D u+8AAA u+4E2D u+6587}
-test http-idna-3.19-D {puny decode: examples from RFC 3492} {
+test http-idna-3.19-D.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode Proprostnemluvesky-uyb24dma41a]
} [list {*}{
u+0050 u+0072 u+006F u+010D u+0070 u+0072 u+006F u+0073 u+0074
u+011B u+006E u+0065 u+006D u+006C u+0075 u+0076 u+00ED u+010D
u+0065 u+0073 u+006B u+0079
}]
-test http-idna-3.19-E {puny decode: examples from RFC 3492} {
+test http-idna-3.19-E.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode 4dbcagdahymbxekheh6e0a7fei0b]
} [list {*}{
u+05DC u+05DE u+05D4 u+05D4 u+05DD u+05E4 u+05E9 u+05D5 u+05D8
u+05DC u+05D0 u+05DE u+05D3 u+05D1 u+05E8 u+05D9 u+05DD u+05E2
u+05D1 u+05E8 u+05D9 u+05EA
}]
-test http-idna-3.19-F {puny decode: examples from RFC 3492} {
+test http-idna-3.19-F.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd]
} [list {*}{
@@ -1005,13 +1013,13 @@ test http-idna-3.19-F {puny decode: examples from RFC 3492} {
u+0940 u+0902 u+092C u+094B u+0932 u+0938 u+0915 u+0924 u+0947
u+0939 u+0948 u+0902
}]
-test http-idna-3.19-G {puny decode: examples from RFC 3492} {
+test http-idna-3.19-G.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa]
} [list {*}{
u+306A u+305C u+307F u+3093 u+306A u+65E5 u+672C u+8A9E u+3092
u+8A71 u+3057 u+3066 u+304F u+308C u+306A u+3044 u+306E u+304B
}]
-test http-idna-3.19-H {puny decode: examples from RFC 3492} {
+test http-idna-3.19-H.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c]
} [list {*}{
@@ -1019,7 +1027,7 @@ test http-idna-3.19-H {puny decode: examples from RFC 3492} {
u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74
u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C
}]
-test http-idna-3.19-I {puny decode: examples from RFC 3492} {
+test http-idna-3.19-I.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode b1abfaaepdrnnbgefbadotcwatmq2g4l]
} [list {*}{
u+043F u+043E u+0447 u+0435 u+043C u+0443 u+0436 u+0435 u+043E
@@ -1027,7 +1035,7 @@ test http-idna-3.19-I {puny decode: examples from RFC 3492} {
u+044F u+0442 u+043F u+043E u+0440 u+0443 u+0441 u+0441 u+043A
u+0438
}]
-test http-idna-3.19-J {puny decode: examples from RFC 3492} {
+test http-idna-3.19-J.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
PorqunopuedensimplementehablarenEspaol-fmd56a]
} [list {*}{
@@ -1037,7 +1045,7 @@ test http-idna-3.19-J {puny decode: examples from RFC 3492} {
u+0062 u+006C u+0061 u+0072 u+0065 u+006E u+0045 u+0073 u+0070
u+0061 u+00F1 u+006F u+006C
}]
-test http-idna-3.19-K {puny decode: examples from RFC 3492} {
+test http-idna-3.19-K.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode \
TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g]
} [list {*}{
@@ -1046,70 +1054,70 @@ test http-idna-3.19-K {puny decode: examples from RFC 3492} {
u+1EC9 u+006E u+00F3 u+0069 u+0074 u+0069 u+1EBF u+006E u+0067
u+0056 u+0069 u+1EC7 u+0074
}]
-test http-idna-3.19-L {puny decode: examples from RFC 3492} {
+test http-idna-3.19-L.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode 3B-ww4c5e180e575a65lsy2b]
} {u+0033 u+5E74 u+0042 u+7D44 u+91D1 u+516B u+5148 u+751F}
-test http-idna-3.19-M {puny decode: examples from RFC 3492} {
+test http-idna-3.19-M.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode -with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n]
} [list {*}{
u+5B89 u+5BA4 u+5948 u+7F8E u+6075 u+002D u+0077 u+0069 u+0074
u+0068 u+002D u+0053 u+0055 u+0050 u+0045 u+0052 u+002D u+004D
u+004F u+004E u+004B u+0045 u+0059 u+0053
}]
-test http-idna-3.19-N {puny decode: examples from RFC 3492} {
+test http-idna-3.19-N.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode Hello-Another-Way--fc4qua05auwb3674vfr0b]
} [list {*}{
u+0048 u+0065 u+006C u+006C u+006F u+002D u+0041 u+006E u+006F
u+0074 u+0068 u+0065 u+0072 u+002D u+0057 u+0061 u+0079 u+002D
u+305D u+308C u+305E u+308C u+306E u+5834 u+6240
}]
-test http-idna-3.19-O {puny decode: examples from RFC 3492} {
+test http-idna-3.19-O.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode 2-u9tlzr9756bt3uc0v]
} {u+3072 u+3068 u+3064 u+5C4B u+6839 u+306E u+4E0B u+0032}
-test http-idna-3.19-P {puny decode: examples from RFC 3492} {
+test http-idna-3.19-P.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode MajiKoi5-783gue6qz075azm5e]
} [list {*}{
u+004D u+0061 u+006A u+0069 u+3067 u+004B u+006F u+0069 u+3059
u+308B u+0035 u+79D2 u+524D
}]
-test http-idna-3.19-Q {puny decode: examples from RFC 3492} {
+test http-idna-3.19-Q.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode de-jg4avhby1noc0d]
} {u+30D1 u+30D5 u+30A3 u+30FC u+0064 u+0065 u+30EB u+30F3 u+30D0}
-test http-idna-3.19-R {puny decode: examples from RFC 3492} {
+test http-idna-3.19-R.$ThreadLevel {puny decode: examples from RFC 3492} {
hexify [::tcl::idna puny decode d9juau41awczczp]
} {u+305D u+306E u+30B9 u+30D4 u+30FC u+30C9 u+3067}
-test http-idna-3.19-S {puny decode: examples from RFC 3492} {
+test http-idna-3.19-S.$ThreadLevel {puny decode: examples from RFC 3492} {
::tcl::idna puny decode {-> $1.00 <--}
} {-> $1.00 <-}
rename hexify ""
-test http-idna-4.1 {IDNA encoding} {
+test http-idna-4.1.$ThreadLevel {IDNA encoding} {
::tcl::idna encode abc.def
} abc.def
-test http-idna-4.2 {IDNA encoding} {
+test http-idna-4.2.$ThreadLevel {IDNA encoding} {
::tcl::idna encode a€b€c.def
} xn--abc-k50ab.def
-test http-idna-4.3 {IDNA encoding} {
+test http-idna-4.3.$ThreadLevel {IDNA encoding} {
::tcl::idna encode def.a€b€c
} def.xn--abc-k50ab
-test http-idna-4.4 {IDNA encoding} {
+test http-idna-4.4.$ThreadLevel {IDNA encoding} {
::tcl::idna encode ABC.DEF
} ABC.DEF
-test http-idna-4.5 {IDNA encoding} {
+test http-idna-4.5.$ThreadLevel {IDNA encoding} {
::tcl::idna encode A€B€C.def
} xn--ABC-k50ab.def
-test http-idna-4.6 {IDNA encoding: invalid edge case} {
+test http-idna-4.6.$ThreadLevel {IDNA encoding: invalid edge case} {
# Should this be an error?
::tcl::idna encode abc..def
} abc..def
-test http-idna-4.7 {IDNA encoding: invalid char} -returnCodes error -body {
+test http-idna-4.7.$ThreadLevel {IDNA encoding: invalid char} -returnCodes error -body {
::tcl::idna encode abc.$.def
} -result {bad character "$" in DNS name}
-test http-idna-4.7.1 {IDNA encoding: invalid char} {
+test http-idna-4.7.1.$ThreadLevel {IDNA encoding: invalid char} {
catch {::tcl::idna encode abc.$.def} -> opt
dict get $opt -errorcode
} {IDNA INVALID_NAME_CHARACTER {$}}
-test http-idna-4.8 {IDNA encoding: empty} {
+test http-idna-4.8.$ThreadLevel {IDNA encoding: empty} {
::tcl::idna encode ""
} {}
set overlong www.[join [subst [string map {u+ \\u} {
@@ -1117,44 +1125,44 @@ set overlong www.[join [subst [string map {u+ \\u} {
u+D55C u+AD6D u+C5B4 u+B97C u+C774 u+D574 u+D55C u+B2E4 u+BA74
u+C5BC u+B9C8 u+B098 u+C88B u+C744 u+AE4C
}]] ""].com
-test http-idna-4.9 {IDNA encoding: max lengths from RFC 5890} -body {
+test http-idna-4.9.$ThreadLevel {IDNA encoding: max lengths from RFC 5890} -body {
::tcl::idna encode $overlong
} -returnCodes error -result "hostname part too long"
-test http-idna-4.9.1 {IDNA encoding: max lengths from RFC 5890} {
+test http-idna-4.9.1.$ThreadLevel {IDNA encoding: max lengths from RFC 5890} {
catch {::tcl::idna encode $overlong} -> opt
dict get $opt -errorcode
} {IDNA OVERLONG_PART xn--989aomsvi5e83db1d2a355cv1e0vak1dwrv93d5xbh15a0dt30a5jpsd879ccm6fea98c}
unset overlong
-test http-idna-4.10 {IDNA encoding: edge cases} {
+test http-idna-4.10.$ThreadLevel {IDNA encoding: edge cases} {
::tcl::idna encode passé.example.com
} xn--pass-epa.example.com
-test http-idna-5.1 {IDNA decoding} {
+test http-idna-5.1.$ThreadLevel {IDNA decoding} {
::tcl::idna decode abc.def
} abc.def
-test http-idna-5.2 {IDNA decoding} {
+test http-idna-5.2.$ThreadLevel {IDNA decoding} {
# Invalid entry that's just a wrapper
::tcl::idna decode xn--abc-.def
} abc.def
-test http-idna-5.3 {IDNA decoding} {
+test http-idna-5.3.$ThreadLevel {IDNA decoding} {
# Invalid entry that's just a wrapper
::tcl::idna decode xn--abc-.xn--def-
} abc.def
-test http-idna-5.4 {IDNA decoding} {
+test http-idna-5.4.$ThreadLevel {IDNA decoding} {
# Invalid entry that's just a wrapper
::tcl::idna decode XN--abc-.XN--def-
} abc.def
-test http-idna-5.5 {IDNA decoding: error cases} -returnCodes error -body {
+test http-idna-5.5.$ThreadLevel {IDNA decoding: error cases} -returnCodes error -body {
::tcl::idna decode xn--$$$.example.com
} -result {bad decode character "$"}
-test http-idna-5.5.1 {IDNA decoding: error cases} {
+test http-idna-5.5.1.$ThreadLevel {IDNA decoding: error cases} {
catch {::tcl::idna decode xn--$$$.example.com} -> opt
dict get $opt -errorcode
} {PUNYCODE BAD_INPUT CHAR}
-test http-idna-5.6 {IDNA decoding: error cases} -returnCodes error -body {
+test http-idna-5.6.$ThreadLevel {IDNA decoding: error cases} -returnCodes error -body {
::tcl::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def
} -result {exceeded input data}
-test http-idna-5.6.1 {IDNA decoding: error cases} {
+test http-idna-5.6.1.$ThreadLevel {IDNA decoding: error cases} {
catch {::tcl::idna decode xn--a-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.def} -> opt
dict get $opt -errorcode
} {PUNYCODE BAD_INPUT LENGTH}
@@ -1164,8 +1172,8 @@ catch {unset url}
catch {unset badurl}
catch {unset port}
catch {unset data}
-if {[info exists httpthread]} {
- thread::release $httpthread
+if {[llength $threadStack]} {
+ eval [lpop threadStack]
} else {
close $listen
}
diff --git a/tests/http11.test b/tests/http11.test
index 71ef4c7..55e7d39 100644
--- a/tests/http11.test
+++ b/tests/http11.test
@@ -108,7 +108,7 @@ http::config -threadlevel $ThreadLevel
# -------------------------------------------------------------------------
-test http11-1.0 "normal request for document " -setup {
+test http11-1.0.$ThreadLevel "normal request for document " -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html -timeout 10000]
@@ -119,7 +119,7 @@ test http11-1.0 "normal request for document " -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close}
-test http11-1.1 "normal,gzip,non-chunked" -setup {
+test http11-1.1.$ThreadLevel "normal,gzip,non-chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -133,7 +133,7 @@ test http11-1.1 "normal,gzip,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok gzip {} {content-encoding gzip} {}}
-test http11-1.2 "normal,deflated,non-chunked" -setup {
+test http11-1.2.$ThreadLevel "normal,deflated,non-chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -146,7 +146,7 @@ test http11-1.2 "normal,deflated,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate {}}
-test http11-1.2.1 "normal,deflated,non-chunked,msdeflate" -setup {
+test http11-1.2.1.$ThreadLevel "normal,deflated,non-chunked,msdeflate" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1&msdeflate=1 \
@@ -159,7 +159,7 @@ test http11-1.2.1 "normal,deflated,non-chunked,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate {}}
-test http11-1.3 "normal,compressed,non-chunked" -constraints badCompress -setup {
+test http11-1.3.$ThreadLevel "normal,compressed,non-chunked" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -174,7 +174,7 @@ test http11-1.3 "normal,compressed,non-chunked" -constraints badCompress -setup
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok compress {}}
-test http11-1.4 "normal,identity,non-chunked" -setup {
+test http11-1.4.$ThreadLevel "normal,identity,non-chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -187,7 +187,7 @@ test http11-1.4 "normal,identity,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} {}}
-test http11-1.5 "normal request for document, unsupported coding" -setup {
+test http11-1.5.$ThreadLevel "normal request for document, unsupported coding" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -200,7 +200,7 @@ test http11-1.5 "normal request for document, unsupported coding" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {}}
-test http11-1.6 "normal, specify 1.1 " -setup {
+test http11-1.6.$ThreadLevel "normal, specify 1.1 " -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -214,7 +214,7 @@ test http11-1.6 "normal, specify 1.1 " -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close chunked {connection close} {transfer-encoding chunked}}
-test http11-1.7 "normal, 1.1 and keepalive " -setup {
+test http11-1.7.$ThreadLevel "normal, 1.1 and keepalive " -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -227,7 +227,7 @@ test http11-1.7 "normal, 1.1 and keepalive " -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} chunked}
-test http11-1.8 "normal, 1.1 and keepalive, server close" -setup {
+test http11-1.8.$ThreadLevel "normal, 1.1 and keepalive, server close" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 \
@@ -240,7 +240,7 @@ test http11-1.8 "normal, 1.1 and keepalive, server close" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {}}
-test http11-1.9 "normal,gzip,chunked" -setup {
+test http11-1.9.$ThreadLevel "normal,gzip,chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -253,7 +253,7 @@ test http11-1.9 "normal,gzip,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok gzip chunked}
-test http11-1.10 "normal,deflate,chunked" -setup {
+test http11-1.10.$ThreadLevel "normal,deflate,chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -266,7 +266,7 @@ test http11-1.10 "normal,deflate,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate chunked}
-test http11-1.10.1 "normal,deflate,chunked,msdeflate" -setup {
+test http11-1.10.1.$ThreadLevel "normal,deflate,chunked,msdeflate" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?msdeflate=1 \
@@ -279,7 +279,7 @@ test http11-1.10.1 "normal,deflate,chunked,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok deflate chunked}
-test http11-1.11 "normal,compress,chunked" -constraints badCompress -setup {
+test http11-1.11.$ThreadLevel "normal,compress,chunked" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -294,7 +294,7 @@ test http11-1.11 "normal,compress,chunked" -constraints badCompress -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok compress chunked}
-test http11-1.12 "normal,identity,chunked" -setup {
+test http11-1.12.$ThreadLevel "normal,identity,chunked" -setup {
variable httpd [create_httpd]
} -body {
set tok [http::geturl http://localhost:$httpd_port/testdoc.html \
@@ -307,7 +307,7 @@ test http11-1.12 "normal,identity,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} chunked}
-test http11-1.13 "normal, 1.1 and keepalive as server default, no zip" -setup {
+test http11-1.13.$ThreadLevel "normal, 1.1 and keepalive as server default, no zip" -setup {
variable httpd [create_httpd]
set zipTmp [http::config -zip]
http::config -zip 0
@@ -346,7 +346,7 @@ proc progressPause {var token total current} {
return
}
-test http11-2.0 "-channel" -setup {
+test http11-2.0.$ThreadLevel "-channel" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -364,7 +364,7 @@ test http11-2.0 "-channel" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close chunked}
-test http11-2.1 "-channel, encoding gzip" -setup {
+test http11-2.1.$ThreadLevel "-channel, encoding gzip" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -387,7 +387,7 @@ test http11-2.1 "-channel, encoding gzip" -setup {
# Cf. Bug [3610253] "CopyChunk does not drain decompressor(s)"
# This test failed before the bugfix.
# The pass/fail depended on file size.
-test http11-2.1.1 "-channel, encoding gzip" -setup {
+test http11-2.1.1.$ThreadLevel "-channel, encoding gzip" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
set fileName largedoc.html
@@ -408,7 +408,7 @@ test http11-2.1.1 "-channel, encoding gzip" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close gzip chunked -- 0 bytes lost}
-test http11-2.2 "-channel, encoding deflate" -setup {
+test http11-2.2.$ThreadLevel "-channel, encoding deflate" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -427,7 +427,7 @@ test http11-2.2 "-channel, encoding deflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate chunked}
-test http11-2.2.1 "-channel, encoding deflate,msdeflate" -setup {
+test http11-2.2.1.$ThreadLevel "-channel, encoding deflate,msdeflate" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -446,7 +446,7 @@ test http11-2.2.1 "-channel, encoding deflate,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate chunked}
-test http11-2.3 "-channel,encoding compress" -constraints badCompress -setup {
+test http11-2.3.$ThreadLevel "-channel,encoding compress" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -468,7 +468,7 @@ test http11-2.3 "-channel,encoding compress" -constraints badCompress -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close compress chunked}
-test http11-2.4 "-channel,encoding identity" -setup {
+test http11-2.4.$ThreadLevel "-channel,encoding identity" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -488,7 +488,7 @@ test http11-2.4 "-channel,encoding identity" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked}
-test http11-2.4.1 "-channel,encoding identity with -progress" -setup {
+test http11-2.4.1.$ThreadLevel "-channel,encoding identity with -progress" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
set logdata ""
@@ -514,7 +514,7 @@ test http11-2.4.1 "-channel,encoding identity with -progress" -setup {
unset -nocomplain logdata data
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked 0 0}
-test http11-2.4.2 "-channel,encoding identity with -progress progressPause enters event loop" -constraints knownBug -setup {
+test http11-2.4.2.$ThreadLevel "-channel,encoding identity with -progress progressPause enters event loop" -constraints knownBug -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
set logdata ""
@@ -540,7 +540,7 @@ test http11-2.4.2 "-channel,encoding identity with -progress progressPause enter
unset -nocomplain logdata data ::WaitHere
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked 0 0}
-test http11-2.5 "-channel,encoding unsupported" -setup {
+test http11-2.5.$ThreadLevel "-channel,encoding unsupported" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -560,7 +560,7 @@ test http11-2.5 "-channel,encoding unsupported" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} chunked}
-test http11-2.6 "-channel,encoding gzip,non-chunked" -setup {
+test http11-2.6.$ThreadLevel "-channel,encoding gzip,non-chunked" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -580,7 +580,7 @@ test http11-2.6 "-channel,encoding gzip,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close gzip {} 0}
-test http11-2.7 "-channel,encoding deflate,non-chunked" -setup {
+test http11-2.7.$ThreadLevel "-channel,encoding deflate,non-chunked" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -600,7 +600,7 @@ test http11-2.7 "-channel,encoding deflate,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate {} 0}
-test http11-2.7.1 "-channel,encoding deflate,non-chunked,msdeflate" -constraints knownBug -setup {
+test http11-2.7.1.$ThreadLevel "-channel,encoding deflate,non-chunked,msdeflate" -constraints knownBug -setup {
# Test fails because a -channel can only try one un-deflate algorithm, and the
# compliant "decompress" is tried, not the non-compliant "inflate" of
# the MS browser implementation.
@@ -623,7 +623,7 @@ test http11-2.7.1 "-channel,encoding deflate,non-chunked,msdeflate" -constraints
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close deflate {} 0}
-test http11-2.8 "-channel,encoding compress,non-chunked" -constraints badCompress -setup {
+test http11-2.8.$ThreadLevel "-channel,encoding compress,non-chunked" -constraints badCompress -setup {
# The Tcl "compress" algorithm appears to be incorrect and has been removed.
# Bug [a13b9d0ce1].
variable httpd [create_httpd]
@@ -645,7 +645,7 @@ test http11-2.8 "-channel,encoding compress,non-chunked" -constraints badCompres
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close compress {} 0}
-test http11-2.9 "-channel,encoding identity,non-chunked" -setup {
+test http11-2.9.$ThreadLevel "-channel,encoding identity,non-chunked" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -665,7 +665,7 @@ test http11-2.9 "-channel,encoding identity,non-chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} {} 0}
-test http11-2.10 "-channel,deflate,keepalive" -setup {
+test http11-2.10.$ThreadLevel "-channel,deflate,keepalive" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -686,7 +686,7 @@ test http11-2.10 "-channel,deflate,keepalive" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} deflate chunked 0}
-test http11-2.10.1 "-channel,deflate,keepalive,msdeflate" -setup {
+test http11-2.10.1.$ThreadLevel "-channel,deflate,keepalive,msdeflate" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -707,7 +707,7 @@ test http11-2.10.1 "-channel,deflate,keepalive,msdeflate" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} deflate chunked 0}
-test http11-2.11 "-channel,identity,keepalive" -setup {
+test http11-2.11.$ThreadLevel "-channel,identity,keepalive" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -727,7 +727,7 @@ test http11-2.11 "-channel,identity,keepalive" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok {} {} chunked}
-test http11-2.12 "-channel,negotiate,keepalive" -setup {
+test http11-2.12.$ThreadLevel "-channel,negotiate,keepalive" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
} -body {
@@ -775,7 +775,7 @@ proc handlerPause {var sock token} {
return [string length $chunk]
}
-test http11-3.0 "-handler,close,identity" -setup {
+test http11-3.0.$ThreadLevel "-handler,close,identity" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -792,7 +792,7 @@ test http11-3.0 "-handler,close,identity" -setup {
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.1 "-handler,protocol1.0" -setup {
+test http11-3.1.$ThreadLevel "-handler,protocol1.0" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -810,7 +810,7 @@ test http11-3.1 "-handler,protocol1.0" -setup {
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.2 "-handler,close,chunked" -setup {
+test http11-3.2.$ThreadLevel "-handler,close,chunked" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -828,7 +828,7 @@ test http11-3.2 "-handler,close,chunked" -setup {
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.3 "-handler,keepalive,chunked" -setup {
+test http11-3.3.$ThreadLevel "-handler,keepalive,chunked" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -856,7 +856,7 @@ test http11-3.3 "-handler,keepalive,chunked" -setup {
# "Connection: keep-alive", i.e. the server will keep the connection
# open. In HTTP/1.0 this is not the case, and this is a test that
# the Tcl client assumes "Connection: close" by default in HTTP/1.0.
-test http11-3.4 "-handler,close,identity; HTTP/1.0 server does not send Connection: close header or Content-Length" -setup {
+test http11-3.4.$ThreadLevel "-handler,close,identity; HTTP/1.0 server does not send Connection: close header or Content-Length" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -874,7 +874,7 @@ test http11-3.4 "-handler,close,identity; HTTP/1.0 server does not send Connecti
} -result {ok {HTTP/1.0 200 OK} ok {} {} {} 0}
# It is not forbidden for a handler to enter the event loop.
-test http11-3.5 "-handler,close,identity as http11-3.0 but handlerPause enters event loop" -setup {
+test http11-3.5.$ThreadLevel "-handler,close,identity as http11-3.0 but handlerPause enters event loop" -setup {
variable httpd [create_httpd]
set testdata ""
} -body {
@@ -891,7 +891,7 @@ test http11-3.5 "-handler,close,identity as http11-3.0 but handlerPause enters e
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0}
-test http11-3.6 "-handler,close,identity as http11-3.0 but with -progress" -setup {
+test http11-3.6.$ThreadLevel "-handler,close,identity as http11-3.0 but with -progress" -setup {
variable httpd [create_httpd]
set testdata ""
set logdata ""
@@ -912,7 +912,7 @@ test http11-3.6 "-handler,close,identity as http11-3.0 but with -progress" -setu
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0 0 0}
-test http11-3.7 "-handler,close,identity as http11-3.0 but with -progress progressPause enters event loop" -setup {
+test http11-3.7.$ThreadLevel "-handler,close,identity as http11-3.0 but with -progress progressPause enters event loop" -setup {
variable httpd [create_httpd]
set testdata ""
set logdata ""
@@ -933,7 +933,7 @@ test http11-3.7 "-handler,close,identity as http11-3.0 but with -progress progre
halt_httpd
} -result {ok {HTTP/1.0 200 OK} ok close {} {} 0 0 0}
-test http11-3.8 "close,identity no -handler but with -progress" -setup {
+test http11-3.8.$ThreadLevel "close,identity no -handler but with -progress" -setup {
variable httpd [create_httpd]
set logdata ""
} -body {
@@ -954,7 +954,7 @@ test http11-3.8 "close,identity no -handler but with -progress" -setup {
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} {} 0 0 0}
-test http11-3.9 "close,identity no -handler but with -progress progressPause enters event loop" -setup {
+test http11-3.9.$ThreadLevel "close,identity no -handler but with -progress progressPause enters event loop" -setup {
variable httpd [create_httpd]
set logdata ""
} -body {
@@ -975,7 +975,7 @@ test http11-3.9 "close,identity no -handler but with -progress progressPause ent
halt_httpd
} -result {ok {HTTP/1.1 200 OK} ok close {} {} 0 0 0}
-test http11-4.0 "normal post request" -setup {
+test http11-4.0.$ThreadLevel "normal post request" -setup {
variable httpd [create_httpd]
} -body {
set query [http::formatQuery q 1 z 2]
@@ -991,7 +991,7 @@ test http11-4.0 "normal post request" -setup {
halt_httpd
} -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 7}
-test http11-4.1 "normal post request, check query length" -setup {
+test http11-4.1.$ThreadLevel "normal post request, check query length" -setup {
variable httpd [create_httpd]
} -body {
set query [http::formatQuery q 1 z 2]
@@ -1008,7 +1008,7 @@ test http11-4.1 "normal post request, check query length" -setup {
halt_httpd
} -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 7}
-test http11-4.2 "normal post request, check long query length" -setup {
+test http11-4.2.$ThreadLevel "normal post request, check long query length" -setup {
variable httpd [create_httpd]
} -body {
set query [string repeat a 24576]
@@ -1025,7 +1025,7 @@ test http11-4.2 "normal post request, check long query length" -setup {
halt_httpd
} -result {status ok code {HTTP/1.1 200 OK} crc ok connection close query-length 24576}
-test http11-4.3 "normal post request, check channel query length" -setup {
+test http11-4.3.$ThreadLevel "normal post request, check channel query length" -setup {
variable httpd [create_httpd]
set chan [open [makeFile {} testfile.tmp] wb+]
puts -nonewline $chan [string repeat [encoding convertto utf-8 "This is a test\n"] 8192]
diff --git a/tests/httpPipeline.test b/tests/httpPipeline.test
index 161519f..491aae0 100644
--- a/tests/httpPipeline.test
+++ b/tests/httpPipeline.test
@@ -839,7 +839,7 @@ for {set header 1} {$header <= 4} {incr header} {
# Here's the test:
- test httpPipeline-${header}.${footer}${label}-${tag} $name \
+ test httpPipeline-${header}.${footer}${label}-${tag}-$ThreadLevel $name \
-constraints $cons \
-setup [string map [list TE $te] {
# Restore default values for tests:
diff --git a/tests/httpProxy.test b/tests/httpProxy.test
new file mode 100644
index 0000000..90fe828
--- /dev/null
+++ b/tests/httpProxy.test
@@ -0,0 +1,456 @@
+# Commands covered: http::geturl when using a proxy server.
+#
+# This file contains a collection of tests for the http script library.
+# Sourcing this file into Tcl runs the tests and generates output for errors.
+# No output means no errors were found.
+#
+# Copyright © 1991-1993 The Regents of the University of California.
+# Copyright © 1994-1996 Sun Microsystems, Inc.
+# Copyright © 1998-2000 Ajuba Solutions.
+# Copyright © 2022 Keith Nash.
+#
+# See the file "license.terms" for information on usage and redistribution of
+# this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+if {"::tcltest" ni [namespace children]} {
+ package require tcltest 2.5
+ namespace import -force ::tcltest::*
+}
+
+package require http 2.10
+
+proc bgerror {args} {
+ global errorInfo
+ puts stderr "httpProxy.test bgerror"
+ puts stderr [join $args]
+ puts stderr $errorInfo
+}
+
+if {![info exists ThreadLevel]} {
+ if {[catch {package require Thread}] == 0} {
+ set ValueRange {0 1 2}
+ } else {
+ set ValueRange {0 1}
+ }
+
+ # For each value of ThreadLevel, source this file recursively in the
+ # same interpreter.
+ foreach ThreadLevel $ValueRange {
+ source [info script]
+ }
+ catch {unset ThreadLevel}
+ catch {unset ValueRange}
+ return
+}
+
+catch {puts "==== Test with ThreadLevel $ThreadLevel ===="}
+http::config -threadlevel $ThreadLevel
+
+
+#testConstraint needsSquid 1
+#testConstraint needsTls 1
+
+if {[testConstraint needsTls]} {
+ package require tls
+ http::register https 443 [list ::tls::socket -ssl2 0 -ssl3 0 \
+ -tls1 0 -tls1.1 0 -tls1.2 1 -tls1.3 0 -autoservername 1]
+}
+
+# Testing with Squid
+# - Example Squid configuration for Enterprise Linux 8 (Red Hat, Oracle, Rocky,
+# Alma, ...) is in file tests/httpProxySquidConfigForEL8.tar.gz.
+# - Two instances of Squid are launched, one that needs authentication and one
+# that does not.
+# - Each instance of Squid listens on IPv4 and IPv6, on different ports.
+
+# Instance of Squid that does not need authentication.
+set n4host 127.0.0.1
+set n6host ::1
+set n4port 3128
+set n6port 3130
+
+# Instance of Squid that needs authentication.
+set a4host 127.0.0.1
+set a6host ::1
+set a4port 3129
+set a6port 3131
+
+# concat Basic [base64::encode alice:alicia]
+set aliceCreds {Basic YWxpY2U6YWxpY2lh}
+
+# concat Basic [base64::encode intruder:intruder]
+set badCreds {Basic aW50cnVkZXI6aW50cnVkZXI=}
+
+test httpProxy-1.1.$ThreadLevel {squid is running - ipv4 noauth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://$n4host:$n4port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-1.2.$ThreadLevel {squid is running - ipv6 noauth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://\[$n6host\]:$n6port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-1.3.$ThreadLevel {squid is running - ipv4 auth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://$a4host:$a4port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-1.4.$ThreadLevel {squid is running - ipv6 auth} -constraints {needsSquid} -setup {
+} -body {
+ set token [http::geturl http://\[$a6host\]:$a6port/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 400 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-2.1.$ThreadLevel {http no-proxy no-auth} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-2.2.$ThreadLevel {https no-proxy no-auth} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 none} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+}
+
+test httpProxy-2.3.$ThreadLevel {http with-proxy ipv4 no-auth} -constraints {needsSquid} -setup {
+ http::config -proxyhost $n4host -proxyport $n4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 HttpProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-2.4.$ThreadLevel {https with-proxy ipv4 no-auth} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $n4host -proxyport $n4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 SecureProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-2.5.$ThreadLevel {http with-proxy ipv6 no-auth} -constraints {needsSquid} -setup {
+ http::config -proxyhost $n6host -proxyport $n6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 HttpProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-2.6.$ThreadLevel {https with-proxy ipv6 no-auth} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $n6host -proxyport $n6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed]"
+} -result {complete ok 200 SecureProxy} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res
+ http::config -proxyhost {} -proxyport {} -proxynot {}
+}
+
+test httpProxy-3.1.$ThreadLevel {http no-proxy with-auth valid-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.2.$ThreadLevel {https no-proxy with-auth valid-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.3.$ThreadLevel {http with-proxy ipv4 with-auth valid-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.4.$ThreadLevel {https with-proxy ipv4 with-auth valid-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.5.$ThreadLevel {http with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-3.6.$ThreadLevel {https with-proxy ipv6 with-auth valid-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $aliceCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.1.$ThreadLevel {http no-proxy with-auth no-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.2.$ThreadLevel {https no-proxy with-auth no-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.3.$ThreadLevel {http with-proxy ipv4 with-auth no-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.4.$ThreadLevel {https with-proxy ipv4 with-auth no-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.5.$ThreadLevel {http with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-4.6.$ThreadLevel {https with-proxy ipv6 with-auth no-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth {}
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $aliceCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.1.$ThreadLevel {http no-proxy with-auth bad-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.2.$ThreadLevel {https no-proxy with-auth bad-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost {} -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 200 none 0 0} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.3.$ThreadLevel {http with-proxy ipv4 with-auth bad-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.4.$ThreadLevel {https with-proxy ipv4 with-auth bad-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a4host -proxyport $a4port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.5.$ThreadLevel {http with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquid} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl http://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 HttpProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+test httpProxy-5.6.$ThreadLevel {https with-proxy ipv6 with-auth bad-creds-provided} -constraints {needsSquid needsTls} -setup {
+ http::config -proxyhost $a6host -proxyport $a6port -proxynot {127.0.0.1 localhost} -proxyauth $badCreds
+} -body {
+ set token [http::geturl https://www.google.com/]
+ set ri [http::responseInfo $token]
+ set pos1 [lsearch -exact [string tolower [set ${token}(requestHeaders)]] proxy-authorization]
+ set pos2 [lsearch -exact [set ${token}(requestHeaders)] $badCreds]
+ set res "[dict get $ri stage] [dict get $ri status] [dict get $ri responseCode] [dict get $ri proxyUsed] [expr {$pos1 > -1}] [expr {$pos2 > -1}]"
+} -result {complete ok 407 SecureProxy 1 1} -cleanup {
+ http::cleanup $token
+ unset -nocomplain ri res pos1 pos2
+ http::config -proxyhost {} -proxyport {} -proxynot {} -proxyauth {}
+}
+
+# cleanup
+unset -nocomplain n4host n6host n4port n6port a4host a6host a4port a6port aliceCreds badCreds
+
+rename bgerror {}
+
+::tcltest::cleanupTests
+
+# Local variables:
+# mode: tcl
+# End:
+
diff --git a/tests/httpProxySquidConfigForEL8.tar.gz b/tests/httpProxySquidConfigForEL8.tar.gz
new file mode 100644
index 0000000..a94dbdb
--- /dev/null
+++ b/tests/httpProxySquidConfigForEL8.tar.gz
Binary files differ
diff --git a/tests/io.test b/tests/io.test
index 3241625..04c9cd2 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -2093,13 +2093,13 @@ test io-20.2 {Tcl_CreateChannel: initial settings} {win} {
set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]]
close $f
set x
-} [list [list \x1A ""] {auto crlf}]
+} {{} {auto crlf}}
test io-20.3 {Tcl_CreateChannel: initial settings} {unix} {
set f [open $path(test1) w+]
set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]]
close $f
set x
-} {{{} {}} {auto lf}}
+} {{} {auto lf}}
set path(stdout) [makeFile {} stdout]
test io-20.5 {Tcl_CreateChannel: install channel in empty slot} stdio {
set f [open $path(script) w]
@@ -5038,7 +5038,7 @@ test io-35.6 {Tcl_Eof, eof char, lf write, auto read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.7 {Tcl_Eof, eof char, lf write, lf read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5052,7 +5052,7 @@ test io-35.7 {Tcl_Eof, eof char, lf write, lf read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.8 {Tcl_Eof, eof char, cr write, auto read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5066,7 +5066,7 @@ test io-35.8 {Tcl_Eof, eof char, cr write, auto read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.9 {Tcl_Eof, eof char, cr write, cr read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5080,7 +5080,7 @@ test io-35.9 {Tcl_Eof, eof char, cr write, cr read} {
set e [eof $f]
close $f
list $s $l $e
-} {9 8 1}
+} {8 8 1}
test io-35.10 {Tcl_Eof, eof char, crlf write, auto read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5094,7 +5094,7 @@ test io-35.10 {Tcl_Eof, eof char, crlf write, auto read} {
set e [eof $f]
close $f
list $s $l $e
-} {11 8 1}
+} {10 8 1}
test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5108,7 +5108,7 @@ test io-35.11 {Tcl_Eof, eof char, crlf write, crlf read} {
set e [eof $f]
close $f
list $s $l $e
-} {11 8 1}
+} {10 8 1}
test io-35.12 {Tcl_Eof, eof char in middle, lf write, auto read} {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5226,7 +5226,7 @@ test io-35.18a {Tcl_Eof, eof char, cr write, crlf read} -body {
set e [eof $f]
close $f
list $s $l $e [scan [string index $in end] %c]
-} -result {9 8 1 13}
+} -result {8 8 1 13}
test io-35.18b {Tcl_Eof, eof char, cr write, crlf read} -body {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5240,7 +5240,7 @@ test io-35.18b {Tcl_Eof, eof char, cr write, crlf read} -body {
set e [eof $f]
close $f
list $s $l $e [scan [string index $in end] %c]
-} -result {2 1 1 13}
+} -result {1 1 1 13}
test io-35.18c {Tcl_Eof, eof char, cr write, crlf read} -body {
file delete $path(test1)
set f [open $path(test1) w]
@@ -5756,30 +5756,30 @@ test io-39.21 {Tcl_SetChannelOption, setting read mode independently} \
close $s2
set modes
} {auto crlf}
-test io-39.22 {Tcl_SetChannelOption, invariance} {unix} {
+test io-39.22 {Tcl_SetChannelOption, invariance} {unix deprecated} {
file delete $path(test1)
set f1 [open $path(test1) w+]
set l ""
lappend l [fconfigure $f1 -eofchar]
- fconfigure $f1 -eofchar {ON GO}
+ fconfigure $f1 -eofchar {O {}}
lappend l [fconfigure $f1 -eofchar]
fconfigure $f1 -eofchar D
lappend l [fconfigure $f1 -eofchar]
close $f1
set l
-} {{{} {}} {O G} {D D}}
-test io-39.22a {Tcl_SetChannelOption, invariance} {
+} {{} O D}
+test io-39.22a {Tcl_SetChannelOption, invariance} deprecated {
file delete $path(test1)
set f1 [open $path(test1) w+]
set l [list]
- fconfigure $f1 -eofchar {ON GO}
+ fconfigure $f1 -eofchar {O {}}
lappend l [fconfigure $f1 -eofchar]
fconfigure $f1 -eofchar D
lappend l [fconfigure $f1 -eofchar]
lappend l [list [catch {fconfigure $f1 -eofchar {1 2 3}} msg] $msg]
close $f1
set l
-} {{O G} {D D} {1 {bad value for -eofchar: should be a list of zero, one, or two elements}}}
+} {O D {1 {bad value for -eofchar: must be non-NUL ASCII character}}}
test io-39.23 {Tcl_GetChannelOption, server socket is not readable or
writeable, it should still have valid -eofchar and -translation options } {
set l [list]
@@ -5787,7 +5787,7 @@ test io-39.23 {Tcl_GetChannelOption, server socket is not readable or
lappend l [fconfigure $sock -eofchar] [fconfigure $sock -translation]
close $sock
set l
-} {{{}} auto}
+} {{} auto}
test io-39.24 {Tcl_SetChannelOption, server socket is not readable or
writable so we can't change -eofchar or -translation } {
set l [list]
@@ -5796,7 +5796,7 @@ test io-39.24 {Tcl_SetChannelOption, server socket is not readable or
lappend l [fconfigure $sock -eofchar] [fconfigure $sock -translation]
close $sock
set l
-} {{{}} auto}
+} {{} auto}
test io-40.1 {POSIX open access modes: RDWR} {
file delete $path(test3)
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index 20418f3..9e53201 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -1363,7 +1363,7 @@ test iocmd-25.1 {chan configure, cgetall, standard options} -match glob -body {
close $c
rename foo {}
set res
-} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
+} -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
test iocmd-25.2 {chan configure, cgetall, no options} -match glob -body {
set res {}
proc foo {args} {oninit cget cgetall; onfinal; track; return ""}
@@ -1372,7 +1372,7 @@ test iocmd-25.2 {chan configure, cgetall, no options} -match glob -body {
close $c
rename foo {}
set res
-} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
+} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -nocomplainencoding 0 -strictencoding 0 -translation {auto *}}}
test iocmd-25.3 {chan configure, cgetall, regular result} -match glob -body {
set res {}
proc foo {args} {
@@ -1384,7 +1384,7 @@ test iocmd-25.3 {chan configure, cgetall, regular result} -match glob -body {
close $c
rename foo {}
set res
-} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} -nocomplainencoding 0 -strictencoding 0 -translation {auto *} -bar foo -snarf x}}
+} -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} -nocomplainencoding 0 -strictencoding 0 -translation {auto *} -bar foo -snarf x}}
test iocmd-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body {
set res {}
proc foo {args} {
@@ -2905,7 +2905,7 @@ test iocmd.tf-25.1 {chan configure, cgetall, standard options} -match glob -body
rename foo {}
set res
} -constraints {testchannel thread} \
- -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} * -translation {auto *}}}
+ -result {{-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *}}}
test iocmd.tf-25.2 {chan configure, cgetall, no options} -match glob -body {
set res {}
proc foo {args} {oninit cget cgetall; onfinal; track; return ""}
@@ -2918,7 +2918,7 @@ test iocmd.tf-25.2 {chan configure, cgetall, no options} -match glob -body {
rename foo {}
set res
} -constraints {testchannel thread} \
- -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} * -translation {auto *}}}
+ -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *}}}
test iocmd.tf-25.3 {chan configure, cgetall, regular result} -match glob -body {
set res {}
proc foo {args} {
@@ -2934,7 +2934,7 @@ test iocmd.tf-25.3 {chan configure, cgetall, regular result} -match glob -body {
rename foo {}
set res
} -constraints {testchannel thread} \
- -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {{} {}} * -translation {auto *} -bar foo -snarf x}}
+ -result {{cgetall rc*} {-blocking 1 -buffering full -buffersize 4096 -encoding * -eofchar {} * -translation {auto *} -bar foo -snarf x}}
test iocmd.tf-25.4 {chan configure, cgetall, bad result, list of uneven length} -match glob -body {
set res {}
proc foo {args} {
diff --git a/tests/load.test b/tests/load.test
index 1f6321e..77a6dec 100644
--- a/tests/load.test
+++ b/tests/load.test
@@ -31,7 +31,7 @@ testConstraint $dll [file readable $x]
# Tests also require that this DLL has not already been loaded.
set loaded "[file tail $x]Loaded"
-set alreadyLoaded [info loaded]
+set alreadyLoaded [info loaded {}]
testConstraint $loaded [expr {![string match *pkga* $alreadyLoaded]}]
set alreadyTotalLoaded [info loaded]
diff --git a/tests/lreplace.test b/tests/lreplace.test
index 2952899..009170e 100644
--- a/tests/lreplace.test
+++ b/tests/lreplace.test
@@ -434,7 +434,7 @@ test ledit-4.4 {ledit edge case} {
set l {1 2 3 4 5}
list [ledit l 3 1] $l
} {{1 2 3 4 5} {1 2 3 4 5}}
-test lreplace-4.5 {lreplace edge case} {
+test ledit-4.5 {ledit edge case} {
lreplace {1 2 3 4 5} 3 0 _
} {1 2 3 _ 4 5}
test ledit-4.6 {ledit end-x: bug a4cb3f06c4} {
diff --git a/tests/lseq.test b/tests/lseq.test
index 19ae348..3f68da4 100644
--- a/tests/lseq.test
+++ b/tests/lseq.test
@@ -255,8 +255,9 @@ test lseq-3.7 {lmap lseq} {
test lseq-3.8 {lrange lseq} {
set r [lrange [lseq 1 100] 10 20]
- lindex [tcl::unsupported::representation $r] 3
-} {arithseries}
+ set empty [lrange [lseq 1 100] 20 10]
+ list $r $empty [lindex [tcl::unsupported::representation $r] 3]
+} {{11 12 13 14 15 16 17 18 19 20 21} {} arithseries}
test lseq-3.9 {lassign lseq} arithSeriesShimmer {
set r [lseq 15]
@@ -509,12 +510,44 @@ test lseq-4.5 {lindex off by one} -body {
unset res
} -result {4 3}
+# Bad refcount on ResultObj
+test lseq-4.6 {lindex flat} -body {
+ set l [lseq 2 10]
+ set cmd lindex
+ set i 4
+ set c [lindex $l $i]
+ set d [$cmd $l $i]
+ set e [lindex [lseq 2 10] $i]
+ set f [$cmd [lseq 2 10] $i]
+ list $c $d $e $f
+} -cleanup {
+ unset l
+ unset e
+} -result [lrepeat 4 6]
+
+test lseq-4.7 {empty list} {
+ list [lseq 0] [join [lseq 0] {}] [join [lseq 1] {}]
+} {{} {} 0}
+
+test lseq-4.8 {error case lrange} -body {
+ lrange [lseq 1 5] fred ginger
+} -returnCodes 1 \
+ -result {bad index "fred": must be integer?[+-]integer? or end?[+-]integer?}
+
+test lseq-4.9 {error case lrange} -body {
+ set fred 7
+ set ginger 8
+ lrange [lseq 1 5] $fred $ginger
+} -returnCodes 1 \
+ -result {index 7 is out of bounds 0 to 4}
+
# Panic when using variable value?
-test lseq-4.6 {panic using variable index} {
+test lseq-4.10 {panic using variable index} {
set i 0
lindex [lseq 10] $i
} {0}
+
# cleanup
::tcltest::cleanupTests
diff --git a/tests/main.test b/tests/main.test
index 4aadd79..2703dc1 100644
--- a/tests/main.test
+++ b/tests/main.test
@@ -606,7 +606,7 @@ namespace eval ::tcl::test::main {
catch {set f [open "|[list [interpreter]]" w+]}
catch {chan configure $f -blocking 0}
} -body {
- type $f "chan configure stdin -eofchar \"\\x1A {}\"
+ type $f "chan configure stdin -eofchar \\x1A
if 1 \{\n\x1A"
variable wait
chan event $f readable \
diff --git a/tests/scan.test b/tests/scan.test
index c6e7922..03a5b46 100644
--- a/tests/scan.test
+++ b/tests/scan.test
@@ -605,7 +605,7 @@ test scan-6.8 {floating-point scanning} -setup {
} -body {
list [scan "4.6 5.2" "%f %f %f %f" a b c d] $a $b $c $d
} -result {2 4.6 5.2 {} {}}
-test scan-6.8 {disallow diget separator in floating-point} -setup {
+test scan-6.9 {disallow diget separator in floating-point} -setup {
set a {}; set b {}; set c {};
} -body {
list [scan "3.14_2.35_98.6" %f_%f_%f a b c ] $a $b $c
diff --git a/tests/socket.test b/tests/socket.test
index 7fdb09d..a0fe2f7 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -308,13 +308,13 @@ test socket_$af-1.1 {arg parsing for socket command} -constraints [list socket s
} -returnCodes error -result {no argument given for -server option}
test socket_$af-1.2 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -server foo
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.3 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myaddr
} -returnCodes error -result {no argument given for -myaddr option}
test socket_$af-1.4 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myaddr $localhost
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.5 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myport
} -returnCodes error -result {no argument given for -myport option}
@@ -323,19 +323,19 @@ test socket_$af-1.6 {arg parsing for socket command} -constraints [list socket s
} -returnCodes error -result {expected integer but got "xxxx"}
test socket_$af-1.7 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -myport 2522
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.8 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -froboz
-} -returnCodes error -result {bad option "-froboz": must be -async, -myaddr, -myport, -reuseaddr, -reuseport, or -server}
+} -returnCodes error -result {bad option "-froboz": must be -async, -backlog, -myaddr, -myport, -reuseaddr, -reuseport, or -server}
test socket_$af-1.9 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -server foo -myport 2521 3333
} -returnCodes error -result {option -myport is not valid for servers}
test socket_$af-1.10 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket host 2528 -junk
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.11 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -server callback 2520 --
-} -returnCodes error -result {wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-reuseaddr boolean? ?-reuseport boolean? ?-myaddr addr? port"}
+} -returnCodes error -result {wrong # args: should be "socket ?-async? ?-myaddr addr? ?-myport myport? host port" or "socket -server command ?-backlog count? ?-myaddr addr? ?-reuseaddr boolean? ?-reuseport boolean? port"}
test socket_$af-1.12 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket foo badport
} -returnCodes error -result {expected integer but got "badport"}
@@ -347,19 +347,19 @@ test socket_$af-1.14 {arg parsing for socket command} -constraints [list socket
} -returnCodes error -result {cannot set -async option for server sockets}
test socket_$af-1.15 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseaddr yes 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.16 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseaddr no 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.17 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseaddr
} -returnCodes error -result {no argument given for -reuseaddr option}
test socket_$af-1.18 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseport yes 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.19 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseport no 4242
-} -returnCodes error -result {options -reuseaddr and -reuseport are only valid for servers}
+} -returnCodes error -result {options -backlog, -reuseaddr, and -reuseport are only valid for servers}
test socket_$af-1.20 {arg parsing for socket command} -constraints [list socket supported_$af] -body {
socket -reuseport
} -returnCodes error -result {no argument given for -reuseport option}