fix flush for `make-pipe-with-specials'

Closes PR 12659
This commit is contained in:
Danny Yoo 2012-03-29 14:19:23 -04:00 committed by Matthew Flatt
parent f301838511
commit 0cfb3f1d39
2 changed files with 18 additions and 1 deletions

View File

@ -710,7 +710,7 @@
;; write
(lambda (str start end buffer? w/break?)
(if (= start end)
#t
0
(begin
(resume-mgr)
(call-with-semaphore

View File

@ -877,6 +877,23 @@
(eq? (cadr r) 4)
(memq (cadr r) '(2 4))))))
(let-values ([(in out) (make-pipe-with-specials)])
(struct str (v)
#:property prop:custom-write
(lambda (a-str port mode)
(let ([recur (case mode
[(#t) write]
[(#f) display]
[else
(lambda (p port)
(print p port mode))])])
(recur (str-v a-str) port))))
(write (str "hello world") out)
(flush-output out)
(test "hello world" read in))
;; --------------------------------------------------
(report-errs)