Skip to content

docs: add testify %% escaping convention to AGENTS.md#316

Merged
SebTardif merged 1 commit into
mainfrom
docs/testify-escaping-convention
Jun 7, 2026
Merged

docs: add testify %% escaping convention to AGENTS.md#316
SebTardif merged 1 commit into
mainfrom
docs/testify-escaping-convention

Conversation

@SebTardif
Copy link
Copy Markdown
Contributor

Add a testing convention for testify %% escaping to prevent the bug
fixed in PR #314 from recurring.

Testify assert.* functions only apply fmt.Sprintf to the message when
len(msgAndArgs) > 1. With a single message string (no format args), %%
prints literally as %% instead of %. This caused 6 incorrect test
messages across chain_test.go and change_filter_test.go.

The convention documents when to use % vs %% with examples.

Testify assert functions only apply fmt.Sprintf when format args are
passed (len(msgAndArgs) > 1). With a single message string, %% prints
literally. This caused 6 incorrect test messages fixed in PR #314.

Document the convention with correct/incorrect examples to prevent
recurrence.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@SebTardif SebTardif enabled auto-merge (squash) June 7, 2026 23:14
@github-actions github-actions Bot added the size/s 10-49 lines changed label Jun 7, 2026
@github-actions github-actions Bot added the area/docs Documentation label Jun 7, 2026
@SebTardif SebTardif merged commit b73af3c into main Jun 7, 2026
32 checks passed
@SebTardif SebTardif deleted the docs/testify-escaping-convention branch June 7, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation size/s 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant