tests for mz and port.ss repairs

svn: r5641
This commit is contained in:
Matthew Flatt 2007-02-20 01:42:25 +00:00
parent dff013afc5
commit 3b10623bad
2 changed files with 17 additions and 0 deletions

View File

@ -64,6 +64,11 @@
(test-file #f)
(test-file #t))
(let-values ([(r w) (make-pipe)])
(write-byte 200 w)
(test #t byte-ready? r)
(test #f char-ready? r))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Based on the MzScheme manual...

View File

@ -297,6 +297,18 @@
(test #\u7238 read p)
(test 'lo read p))
;; Check that make-input-port/read-to-peek isn't trying
;; to use chars when it should use bytes:
(let-values ([(pipe-r pipe-w) (make-pipe)])
(write-byte 200 pipe-w)
(let ([p (make-input-port/read-to-peek 'name
(lambda (s)
(read-bytes-avail!* s pipe-r))
#f
void)])
(test 200 peek-byte p)
(test 200 read-byte p)))
;; read synchronization events
(define (go mk-hello sync atest btest)
(test #t list? (list mk-hello sync atest btest))