Improve output parsing - #151
Merged
Merged
Conversation
When the tests were using helpers like expectEqualStrings, we were not parsing the output correctly. From forum https://forum.exercism.org/t/0-tests-failed-but-not-all-passed/71116/ From Claude: Zig prints per-test lines like `1/N test_x.test.NAME...OK` when a test passes, but when a test fails via a rich helper (expectEqualStrings, expectEqualSlices, or checkAllAllocationFailures's leak detection) the diagnostic is emitted first and the header line ends with a bare `...`. The jq definition def user_output: capture("\\.\\.\\.((?<o>.+)$)") | .o // ""; returned *empty* (not null) when the regex didn't match. `//` doesn't fire on empty, and `map(classify)` silently drops any element whose subexpressions yield empty — so every failing test whose header ended with a bare `...` was quietly removed from the tests array. We now use def user_output: (capture("\\.\\.\\.(?<o>.+)$") | .o) // "";
IsaacG
approved these changes
Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the tests were using helpers like expectEqualStrings, we were not parsing the output correctly.
From forum
https://forum.exercism.org/t/0-tests-failed-but-not-all-passed/71116/
From Claude:
Zig prints per-test lines like
1/N test_x.test.NAME...OKwhen a testpasses, but when a test fails via a rich helper (expectEqualStrings,
expectEqualSlices, or checkAllAllocationFailures's leak detection) the
diagnostic is emitted first and the header line ends with a bare
....The jq definition
returned empty (not null) when the regex didn't match.
//doesn'tfire on empty, and
map(classify)silently drops any element whosesubexpressions yield empty — so every failing test whose header ended
with a bare
...was quietly removed from the tests array.We now use
def user_output: (capture("\.\.\.(?.+)$") | .o) // "";