1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 11:09:54 +00:00

Update test suite to better distinguish functional errors with

localname/peername.
This commit is contained in:
Calvin Rose 2021-11-06 19:19:49 -05:00
parent 3067f4be3a
commit 72c5db8910

View File

@ -152,8 +152,10 @@
(:close s)) (:close s))
(defn check-matching-names [stream] (defn check-matching-names [stream]
(def [my-ip my-port] (net/localname stream)) (def ln (net/localname stream))
(def [remote-ip remote-port] (net/peername stream)) (def pn (net/peername stream))
(def [my-ip my-port] ln)
(def [remote-ip remote-port] pn)
(def msg (string my-ip " " my-port " " remote-ip " " remote-port)) (def msg (string my-ip " " my-port " " remote-ip " " remote-port))
(def buf @"") (def buf @"")
(ev/gather (ev/gather
@ -178,8 +180,7 @@
(defn test-names [] (defn test-names []
(with [conn (net/connect "127.0.0.1" "8000")] (with [conn (net/connect "127.0.0.1" "8000")]
(check-matching-names conn))) (check-matching-names conn)))
(test-names) (repeat 20 (test-names)))
(test-names))
(gccollect)) (gccollect))
# Create pipe # Create pipe