Argentum got a special syntax to define tests right in the source files along with a code that needs to be tested, and a special mode of compilation, designed to support those tests.
using json;
using tests { assert }
...
class MyClass { ... }
fn myFn(s str) int { ... }
test myFnTest (){ //<-- test
assert(myFn("Some input data") == 42);
...
}
log("application started {myFn("some real data")}");
If launched as usual it completely skips tests in the source code and build the application itself.
But if add a command line key `-T "my.*Test"` it ignores main entry point and instead build an app containing all tests matching the given regexp.
It also supports mocks and test-specific fns/classes.
More details here: https://aglang.org/tests/
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.