Learn how to test your Odin exercises on Exercism
Odin exercises within your exercism project directory can be run by changing to the exercise directory, and running odin test ..
cd "$(exercism workspace)"/odin/leap
odin test .
While you are testing, Odin can "vet" your code: it can look for things like unused imports and variables.
Run your tests with
odin test . -vet
For even more checks, add the -strict-style option.
odin test runs each procedure that has the @(test) attribute.
In the test suite, you will notice each test procedure has this attribute. This means that when you launch the tests, each test procedure is going to run.
Exercism generally promotes Test Driven Development, where:
We (the maintainers) did not find an elegant programmatic way to execute a subset of the tests. The test file just became too unwieldy. To develop with TDD, you can edit the test file to simply comment out the tests you are not ready to execute, and uncomment them one-by-one as you code your solution.
For more details, see the Odin Test Runner documentation, and odin test -help.