docs(patterns): fix swapped assert_file_contains arguments - #1210
Merged
Conversation
assert_file_contains takes "file" "search", but three examples in the guide users copy from had them reversed, so bashunit looked for a file literally named 'Error occurred' and failed with "Expected 'Error occurred'" -- which reads as missing content rather than backwards arguments. The line below one of them passed $TEST_LOG to assert_matches, matching the timestamp pattern against the path instead of the file's contents, so it never checked what its own comment described. Executed each example before and after: the originals fail, the corrections pass. Argument order is invisible to the docs-parity guards -- every symbol here exists and is spelled correctly -- so only running the examples finds it. Closes #1209
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.
🤔 Background
Related #1209
assert_file_containstakes"file" "search", but three examples in the guideusers copy from had them reversed:
Copied verbatim it fails with
Expected 'Error occurred', which reads asmissing content rather than backwards arguments.
One line below,
assert_matches "<timestamp regex>" "$TEST_LOG"matched thepattern against the path, never the contents its comment described.
💡 Changes
assert_matchestargetArgument order is invisible to the docs-parity guards — every symbol exists and
is spelled correctly — so only running the examples finds it. Same pass that
found #1207.