From c5d2a041f09785727fad67a457ca2b28aecefe82 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 3 Aug 2017 14:39:59 +0000 Subject: Improved test http-4.16. --- tests/http.test | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/http.test b/tests/http.test index c2d2fe8..5a00cd5 100644 --- a/tests/http.test +++ b/tests/http.test @@ -599,14 +599,20 @@ test http-4.15 {http::Event} -body { } -cleanup { catch {http::cleanup $token} } -returnCodes 1 -match glob -result "couldn't open socket*" -test http-4.16 {Leak with Close vs Keepalive (bug [6ca52aec14]} -body { +test http-4.16 {Leak with Close vs Keepalive (bug [6ca52aec14]} -setup { + proc list-difference {l1 l2} { + lmap item $l2 {if {$item in $l1} continue; set item} + } +} -body { set before [chan names] set token [http::geturl $url -headers {X-Connection keep-alive}] http::cleanup $token update - set after [chan names] - expr {$before eq $after} -} -result 1 + # Compute what channels have been unexpectedly leaked past cleanup + list-difference $before [chan names] +} -cleanup { + rename list-difference {} +} -result {} test http-5.1 {http::formatQuery} { http::formatQuery name1 value1 name2 "value two" -- cgit v0.12