Added more I/O tests

This commit is contained in:
Justin Ethier 2015-06-24 21:22:54 -04:00
parent 674807a9e2
commit 7103f52f8b
2 changed files with 4 additions and 6 deletions

View file

@ -1,10 +1,5 @@
(import (scheme base)
(scheme file)
(scheme write))
; TODO: I think this compiles OK (test), but interpreter does not like it:
;cyclone>
(call-with-output-file "test.txt" (lambda (port) (write 'ok port)))
;Error: Unable to evaluate: ((procedure () ...) <port>)
#t

View file

@ -275,8 +275,11 @@
"test.out"
(lambda ()
(assert:equal "I/O with-*-file test" (read) 'hello-world)))
(call-with-output-file "test.txt" (lambda (port) (write 'ok port))) ;; Note: was a good test, did not always work in icyc
(call-with-input-file "test.txt" (lambda (port) (assert:equal "read input" (read port) 'ok)))
;(write "done with input")
;; TODO: (delete-file "test.out")
;; TODO: (delete-file "test.txt")
;; END I/O
; TODO: use display, output without surrounding quotes