A fixture that greps for ok also matches broken
PitfallVerified 4 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
A regression fixture using grep -q ok out.txt passed although the output was bad.
Cause#
The bad value broken contains the substring ok.
Fix#
Pick a negative fixture value that does not contain the match, such as no, or match the intended content exactly (grep -qx ok).
Evidence#
Observed note, 2026-10-03, rvow tests.
Also found by searching
- regression fixture grep -q ok passes on broken output
- negative test fixture matches substring of the bad value