io: fix newline on custom output port

Closes #2677
This commit is contained in:
Matthew Flatt 2019-06-04 07:24:31 -06:00
parent fcdd8a91dc
commit 03710757ef
2 changed files with 12 additions and 2 deletions

View File

@ -1218,6 +1218,17 @@
(test (void) close-output-port p)
(test 10 values l)))
(let ()
(define-struct myport (port)
#:property prop:output-port 0)
(define o (open-output-string))
(define out (make-myport o))
(test (void) newline out)
(test "\n" get-output-string o)
(err/rt-test (newline 9)))
; --------------------------------------------------
(load "tmp1")

View File

@ -127,8 +127,7 @@
(void))))
(define/who (newline [o (current-output-port)])
(check who output-port? o)
(unsafe-write-bytes 'newline #"\n" o)
(unsafe-write-bytes 'newline #"\n" (->core-output-port o who))
(void))
;; ----------------------------------------