1.2 KiB
1.2 KiB
tests
tests are written in src/test
- tests that test the language will be in the lang subdirectory
- tests that test lily will be in the lily subdirectory
- all tests should return any integer or boolean value.
follow standard practices for exit code.
0
for success,1
for error, etc - all tests should contain the test specification (preferably at the top of the file)
- strings & arrays may be multiline
- argument order does not matter
- all test arguments are optional
tests with no arguments will always pas
timeout
is the max length a test can run before failingargs
are given to the application executableexit
is the exit status of the program (return code)
- if test compilation fails, the test will be considered failed
- tests for lily should try to limit the number of unrelated structures/functions tested.
- tests for lang should be headless (not rely on lily at all)
a trivial example test:
expected := .{
exit: 0,
timeout: 0.5,
stdout: "",
args: .[]
}
main := fn(): u8 {
// test will fail after 0.5s
loop {}
}