A directory for this test's files. jacket test creates it and deletes it after a pass
(--keep-temp keeps it); subtests share their test's directory.
#import "File";
writes_a_file :: (t: *Test) {
path := tprint("%/out.txt", temp_dir(t));
expect(write_entire_file(path, "hi"));
} @testThis one is only checked to compile, not run.
- t: the running test, or any of its subtests.
- loc: where the call is written, shown if the test was given no directory. Leave the default.
temp_dir :: (t: *Test, loc := #caller_location) -> string
A directory for this test's files. jacket test creates it and deletes it after a pass
(--keep-temp keeps it); subtests share their test's directory.
Parameters
- t: *Test
- the running test, or any of its subtests.
- loc := #caller_location
- where the call is written, shown if the test was given no directory. Leave the default.
Returns
- string
#import "File";
writes_a_file :: (t: *Test) {
path := tprint("%/out.txt", temp_dir(t));
expect(write_entire_file(path, "hi"));
} @testThis one is only checked to compile, not run.