Make the demo output newline contract explicit - #101
Open
Fiddlehead-MB wants to merge 1 commit into
Open
Conversation
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.
The observed failure
The built-in demo says each output file must contain exact text, but its checks use shell command substitution:
Command substitution removes trailing newline bytes. As a result, the current check cannot distinguish
alpha readywith no newline, one newline, or multiple trailing newlines. It can report PASS for outputs that are not byte-for-byte identical.The proposed fix
printf ... | diff -u - file.Proposing one LF for these one-line files — happy to match a different convention if the project prefers.
The change is limited to the built-in demo, the README example, and one test. It does not change worker invocation or general check execution.
Verification
alpha.txtbytesb"alpha ready"b"alpha ready\n"b"alpha ready\n\n"b"alpha ready."Executed proof
RINGER_NO_SELF_UPDATE=1 python3 -m unittest discover -s testsAll 254 tests pass on Python 3.12.3.
Related: #31 touches the demo wording but doesn't change the comparison logic — this fix is independent of it. Happy to rebase if #31 lands first.