2007-11-07 11:00:39 -05:00
|
|
|
|
|
|
|
(library (tests input-ports)
|
|
|
|
(export test-input-ports)
|
|
|
|
(import (ikarus) (tests framework))
|
|
|
|
|
|
|
|
|
|
|
|
(define-tests test-input-ports
|
|
|
|
[eof-object?
|
2007-12-10 09:28:48 -05:00
|
|
|
(get-line (open-string-input-port ""))]
|
2007-11-07 11:00:39 -05:00
|
|
|
[(lambda (x) (equal? x "abcd"))
|
2007-12-10 09:28:48 -05:00
|
|
|
(get-line (open-string-input-port "abcd"))]
|
2007-11-07 11:00:39 -05:00
|
|
|
[(lambda (x) (equal? x ""))
|
2007-12-10 09:28:48 -05:00
|
|
|
(get-line (open-string-input-port "\nabcd"))]
|
2007-11-07 11:00:39 -05:00
|
|
|
[(lambda (x) (equal? x "abcd"))
|
2007-12-10 09:28:48 -05:00
|
|
|
(get-line (open-string-input-port "abcd\nefg"))]))
|
2007-11-07 11:00:39 -05:00
|
|
|
|