2323 (remove-test-file "my-test-file")))
2424
2525 (capability 'open (list
26- (test "open returns a file descriptor" (lambda ()
27- (assert (is-file-descriptor? (open "my-test-file" "r")))))
26+ (test "open returns a file descriptor"
27+ (assert (is-file-descriptor? (open "my-test-file" "r"))))
2828
29- (test "opening with non-existant mode, results in error" (lambda () (begin
29+ (test "opening with non-existant mode, results in error"
3030 (assert (is-file-error? (open "my-test-file" "g")))
3131 (assert (is-file-error? (open "my-test-file" "rq")))
32- (assert (is-file-error? (open "my-test-file" "qr"))))))))
32+ (assert (is-file-error? (open "my-test-file" "qr"))))))
3333
3434 (capability 'close (list
3535 (setup (lambda ()
3939 (close test-file)
4040 (set! test-file '()))))
4141
42- (test "a closed file descriptor does not allow further reads" (lambda ()
42+ (test "a closed file descriptor does not allow further reads"
4343 (close test-file)
44- (assert (is-file-error? (read test-file 1)))))
44+ (assert (is-file-error? (read test-file 1))))
4545
46- (test "a closed file descriptor does not allow further writes" (lambda ()
46+ (test "a closed file descriptor does not allow further writes"
4747 (close test-file)
48- (assert (is-file-error? (write test-file "abc")))))))
48+ (assert (is-file-error? (write test-file "abc"))))))
4949
5050 (capability 'read (list
5151 (setup (lambda ()
5555 (close test-file)
5656 (set! test-file '()))))
5757
58- (test "read can read one value" (lambda ()
58+ (test "read can read one value"
5959 (assert-equal
6060 (read test-file 1)
61- "f")))
61+ "f"))
6262
63- (test "read can read all of the content" (lambda ()
63+ (test "read can read all of the content"
6464 (assert-equal
6565 (read test-file 23)
66- "first line\nsecond line")))
66+ "first line\nsecond line"))
6767
68- (test "read on a write-only file is an error" (lambda () ( begin
68+ (test "read on a write-only file is an error" (begin
6969 (close test-file) ; to ensure we can open it write-only
7070 (let
7171 ((write-only-file (open "my-test-file" "w")))
72- (assert (is-file-error? (read write-only-file 1)))))))))))
72+ (assert (is-file-error? (read write-only-file 1))))))))))
0 commit comments