Here in Testing your package presents an example:
use UnitTest;
config const testParam: bool = true;
proc myTest(test: Test) {
test.assertTrue(testParam);
}
But this won't work with the current version. I tried adding the example above and got this:
$ mason test
Updating mason-registry
----------------------------------------------------------------------
No Tests Found
The solution is in UnitTest. Previous example seems to be using the old grammar.
I think we can use this new example in the page of mason instead:
use UnitTest;
config const testParam: bool = true;
proc myTest(test: borrowed Test) throws{
test.assertTrue(testParam);
}
UnitTest.main()
Thanks @Rapiz1 - would you be interested in opening a PR with the following?
@ben-albrecht Sure. Sorry if I'm being naive, where can I start from to add a test for the docs?
I would put it in test/library/packages/UnitTest/docs/.
See here for docs on test system:
https://github.com/chapel-lang/chapel/blob/master/doc/rst/developer/bestPractices/TestSystem.rst#creating-a-simple-test
See other tests in test/library/packages/UnitTest/ for examples to start from.
Thanks. I will look into it soon.
Actually, this may make more sense to put intotest/mason/mason-test/docs
Thanks for pointing this out. I saw it earlier but forgot about it.