Before a lot of work goes into the standard library, it'd be nice to have an in-language Spec library that can be used to test its functionality.
All of the current specs are written in Crystal, and while that's fine and fast to run, it's really verbose for tests that need a lot of setup, and all of that setup has to be repeated for each test, since they all get new instances of the interpreter.
The basic functionality needed is:
define a test with a name.
make assertions on the truthiness of an expression.
output assertion failures as failed specs, including the name of the failing test.
return a non-zero exit status when a test fails.
Further features are all nice-to-haves.
The Spec library should be available as part of the standard library, but not included as part of the prelude (since production code shouldn't need it most of the time).
Some of these features may need other supporting work to be functional (e.g., the non-zero exit status). For simplicity, that work will probably just be rolled into whatever PR comes up for this.
Before a lot of work goes into the standard library, it'd be nice to have an in-language Spec library that can be used to test its functionality.
All of the current specs are written in Crystal, and while that's fine and fast to run, it's really verbose for tests that need a lot of setup, and all of that setup has to be repeated for each test, since they all get new instances of the interpreter.
The basic functionality needed is:
Further features are all nice-to-haves.
The
Spec
library should be available as part of the standard library, but not included as part of the prelude (since production code shouldn't need it most of the time).