Skip to content

docs(ai-agents): assert_equals strips control chars, it does not trim - #1226

Merged
Chemaclass merged 1 commit into
mainfrom
docs/1225-assert-equals-rule
Aug 14, 2026
Merged

docs(ai-agents): assert_equals strips control chars, it does not trim#1226
Chemaclass merged 1 commit into
mainfrom
docs/1225-assert-equals-rule

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1225

The "Drop-in rules for your repo" block described assert_equals as trimming or normalizing. 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 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 what assert_equals is actually for: comparing coloured CLI output.

💡 Changes

  • State what it strips and what it does not, matching the wording in docs/public/bashunit-skill.md, which was already correct
  • Pin both sides of the boundary in the unit tests — colour ignored, spaces compared — next to the existing backslash and escape-sequence cases

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
@Chemaclass Chemaclass added the documentation Improvements or additions to documentation label Aug 14, 2026
@Chemaclass Chemaclass self-assigned this Aug 14, 2026
@Chemaclass
Chemaclass merged commit 31d58ce into main Aug 14, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the docs/1225-assert-equals-rule branch August 14, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant