Change suite 9 test a bit.

This commit is contained in:
Calvin Rose 2020-11-15 10:12:10 -06:00
parent a7ed3dea4b
commit 1759151875
1 changed files with 11 additions and 9 deletions

View File

@ -51,16 +51,18 @@
# Create pipe
(var pipe-counter 0)
(def [reader writer] (os/pipe))
(ev/spawn
(while (ev/read reader 3)
(++ pipe-counter))
(assert (= 20 pipe-counter) "ev/pipe 1"))
(def chan (ev/chan 10))
(let [[reader writer] (os/pipe)]
(ev/spawn
(while (ev/read reader 3)
(++ pipe-counter))
(assert (= 20 pipe-counter) "ev/pipe 1")
(ev/give chan 1))
(for i 0 10
(ev/write writer "xxx---"))
(for i 0 10
(ev/write writer "xxx---"))
(ev/close writer)
(ev/sleep 0.1)
(ev/close writer)
(ev/take chan))
(end-suite)