fix `get-bytevector-all' bug
Closes PR 12327
This commit is contained in:
parent
e361acae0b
commit
8d91efcee4
|
@ -643,7 +643,10 @@
|
|||
(raise-type-error 'get-bytevector-all "binary port" p))
|
||||
(let ([p2 (open-output-bytes)])
|
||||
(copy-port p p2)
|
||||
(get-output-bytes p2 #t)))
|
||||
(let ([s (get-output-bytes p2 #t)])
|
||||
(if (zero? (bytes-length s))
|
||||
eof
|
||||
s))))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
|
|
|
@ -382,6 +382,10 @@
|
|||
(test-transcoders bytevector->string-via-file
|
||||
string->bytevector-via-file))
|
||||
|
||||
(let ((port (open-bytevector-input-port #vu8())))
|
||||
(test (eof-object? (get-bytevector-all port)) #t)
|
||||
(test (eof-object? (get-bytevector-n port 10)) #t))
|
||||
|
||||
(let ([test-i+o
|
||||
(lambda (buf)
|
||||
(let ([p (open-file-input/output-port "io-tmp1"
|
||||
|
|
Loading…
Reference in New Issue
Block a user