added a test case for this commit:

http://git.racket-lang.org/plt/commit/2482816d3d
This commit is contained in:
Robby Findler 2011-02-27 19:02:09 -06:00
parent 2482816d3d
commit 6f48aaeaa7

View File

@ -1317,11 +1317,11 @@
;; TCP ;; TCP
(let ([do-once (let ([do-once
(lambda (evt?) (lambda (evt? localhost)
(let* ( (let* (
[l (tcp-listen 0 5 #t)] [l (tcp-listen 0 5 #t)]
[pn (listen-port l)]) [pn (listen-port l)])
(let-values ([(r1 w1) (tcp-connect "localhost" pn)] (let-values ([(r1 w1) (tcp-connect localhost pn)]
[(r2 w2) (if evt? [(r2 w2) (if evt?
(apply values (sync (tcp-accept-evt l))) (apply values (sync (tcp-accept-evt l)))
(tcp-accept l))]) (tcp-accept l))])
@ -1339,8 +1339,10 @@
(when evt? (when evt?
(test #f sync/timeout 0 (tcp-accept-evt l))) (test #f sync/timeout 0 (tcp-accept-evt l)))
(tcp-close l)))]) (tcp-close l)))])
(do-once #f) (do-once #f "localhost")
(do-once #t)) (do-once #t "localhost")
(do-once #f "::1")
(do-once #t "::1"))
(test #f tcp-port? (current-input-port)) (test #f tcp-port? (current-input-port))
(test #f tcp-port? (current-output-port)) (test #f tcp-port? (current-output-port))