docs(ai-agents): assert_equals strips control chars, it does not trim - #1226
Merged
Conversation
The drop-in rules block said "assert_equals (which trims/normalizes)". It strips ANSI colour codes, tabs and newlines; a space is not a control character, so assert_equals "a" " a " fails like any other mismatch. That block exists to be pasted verbatim into an AGENTS.md or CLAUDE.md, so the error propagates into every repo that adopts it -- and it hides the one thing assert_equals is good for, comparing coloured CLI output. Match the wording already used by docs/public/bashunit-skill.md, which had it right. Pin both sides of the boundary in the unit tests: colour ignored, spaces not. Closes #1225
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 #1225
The "Drop-in rules for your repo" block described
assert_equalsas trimming or normalizing. It strips ANSI colour codes, tabs and newlines — a space is not a control character, soassert_equals "a" " a "fails like any other mismatch.That block is written to be pasted verbatim into an
AGENTS.md/CLAUDE.md, so the error propagates into every repo that adopts it, and it hides whatassert_equalsis actually for: comparing coloured CLI output.💡 Changes
docs/public/bashunit-skill.md, which was already correct