diff options
author | Manlio Perillo <manlio.perillo@gmail.com> | 2023-04-24 11:20:07 +0200 |
---|---|---|
committer | Manlio Perillo <manlio.perillo@gmail.com> | 2023-04-24 11:31:16 +0200 |
commit | 3dd7cdcb3b541b0da4f659aa15ea6d651a45f41a (patch) | |
tree | b6a3d2d9ebd7dc6b8dfdc9005ef14d5e7d6d5c2e /exercises/044_quiz5.zig | |
parent | cec0aa51dbb9bff30f871d3f605bc1f0fbc6b4a4 (diff) |
build: make exercise output more reliable
Currently, ZiglingStep prints the raw exercise output. This is not a
problem when executing `zig build` from the shell, but in a unit test it
is necessary to know when the exercise output ends.
Document that Exercise.output should not have trailing whitespace.
Ensure this is true by adding a check in the validate_exercises
function.
Remove trailing whitespace in exercises 68 and 99.
Simplify the output validation in ZiglingStep.makeInternal.
Checking that the length of the actual and expected output is the same
is not necessary, since trailing whitespace has been removed. Simply do
an exact comparison.
Print the trimmed exercise output, instead of the raw output.
This will ensure that the exercise output always ends with only one LF
character.
Fix some small coding style issues.
Diffstat (limited to 'exercises/044_quiz5.zig')
0 files changed, 0 insertions, 0 deletions