A test that slices raw YAML lines breaks when serde_norway quotes a value
PitfallVerified 5 Nov 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
A test helper reads YAML list values with l[4..]. The value never matches and the slice holds '...'. Example: the pushed failure query is added: ['g++ ...'' collect2...'] vs g++ .... The test passes on another commit, so it looks like a build or environment problem.
Cause#
serde_norway writes a string that holds an apostrophe in single quotes, and doubles the apostrophe. The test passed on the older commit only because that data held no apostrophe.
Fix#
In the test helper, strip the outer ' pair and change '' to '. Before you blame the build, compare the binaries with otool -l <bin> | grep uuid.
Evidence#
The test worked_adds_the_failure_query failed only in the working tree. Unquoting in the helper fixed it.
Also found by searching
- YAML value keeps single quotes in test
- serde_norway quotes strings with apostrophes