Skip to content

Commit

Permalink
Removed mention of NotImplemented in the README
Browse files Browse the repository at this point in the history
  • Loading branch information
gvrooyen committed Aug 30, 2024
1 parent 5f81ce0 commit 1bf9d9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ The `bin/` subdirectory contains several scripts to help you contribute exercise
- Run `bin/configlet create --practice-exercise <slug>` to automatically generate the exercise skeleton in the `exercises/practice/<slug>/` directory and to update `config.json` to reference the new exercise.
You can add `--author <your_exercism_username>` as option to mark yourself as the creator of this exercise (or add it later in the exercise's `.meta/config.json` file.)
- Add a solution stub at the exercise's `<slug>.odin` file.
This is what users will start with when solving the exercise.
This is what students will begin with when they start the exercise.
It should make it as easy as possible to understand what they need to solve, without revealing too much of the solution.
Stub functions should usually panic, e.g. `#panic("Please implement the <stub> function.")`.
- Add tests to `<slug>_test.odin`.
Verify that the slug solution would fail _all_ tests.
Consider adding an error return enumeration such as `NotImplemented` to ensure that the stub solution's return values are invalid for all test cases.
- Implement a reference solution at `.meta/<slug>_example.odin`.
- Use `bin/run_test.sh <slug>` to verify that your reference solution passes.

Expand Down
6 changes: 6 additions & 0 deletions bin/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ function run_test() {
cp ${solution_file} ${tmp_path}/${exercise_safe_name}.odin

# Run the test. If it passes, exit with a message and an error.
# TODO: Check that the stub fails _all_ the tests.
# We only check for a single failed test here -- the stub solution could solve all the cases
# but only fail on the most complicated one. Since the purpose of this test is mostly to
# double-check that the example didn't accidentally get duplicated as the stub, this isn't
# too critical for now.

if odin test ${tmp_path} ; then
echo -e '\nERROR: The stub solution must not pass the tests!\n'
exit 1
Expand Down

0 comments on commit 1bf9d9c

Please sign in to comment.