From b5720f6f105da93a7be6006800f80976195e9079 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 19 Jun 2022 09:31:43 -0500 Subject: [PATCH] On suite0009 errors for localname/peername, add info Tag when the issue in the server or in the client. On windows, sometimes these seemed to get swapped for strange reason. --- test/suite0009.janet | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/suite0009.janet b/test/suite0009.janet index 8a1ecc0d..7da725cd 100644 --- a/test/suite0009.janet +++ b/test/suite0009.janet @@ -164,7 +164,7 @@ (:close s)) -(defn check-matching-names [stream] +(defn check-matching-names [stream tag] (def ln (net/localname stream)) (def pn (net/peername stream)) (def [my-ip my-port] ln) @@ -179,21 +179,20 @@ (= (string my-port) (get comparison 3)) (= remote-ip (get comparison 0)) (= (string remote-port) (get comparison 1))) - (string/format "localname should match peername: msg=%j, buf=%j" msg buf))) + (string/format "%s: localname should match peername: msg=%j, buf=%j" tag msg buf))) # Test on both server and client (defn names-handler [stream] (defer (:close stream) - (check-matching-names stream))) + (check-matching-names stream "server"))) # Test localname and peername -(repeat 20 +(repeat 10 (with [s (net/server "127.0.0.1" "8000" names-handler)] - (defn test-names [] + (repeat 10 (with [conn (net/connect "127.0.0.1" "8000")] - (check-matching-names conn))) - (repeat 20 (test-names))) + (check-matching-names conn "client")))) (gccollect)) # Create pipe