File
Open a file
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then the exit status should be 0.
Examples
procedure |
---|
open-input-file |
open-output-file |
open-binary-input-file |
open-binary-output-file |
Close a file
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then the exit status should be 0.
Examples
procedure |
---|
open-input-file |
open-output-file |
open-binary-input-file |
open-binary-output-file |
Close an input file
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then the exit status should be 0.
Examples
procedure |
---|
open-input-file |
open-binary-input-file |
Close an output file
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then the exit status should be 0.
Examples
procedure |
---|
open-output-file |
open-binary-output-file |
Call a thunk with an input file
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Call a thunk with an output file
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then a file named “foo.txt” should contain exactly:
Call a procedure with an input file
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “A”.
Call a procedure with an output file
Given a file named “main.scm” with:
When I successfully run scheme main.scm
Then a file named “foo.txt” should contain exactly:
Delete a file
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then a file named “foo.txt” should not exist.
Check if a file exists
Given a file named “main.scm” with:
And a file named “foo.txt” with:
When I successfully run scheme main.scm
Then the stdout should contain exactly “<output>”.
Examples
path | output |
---|---|
foo.txt | A |
bar.txt | B |