README drift tests: regex number checks trip on step labels and newlines
@victor-lyhan▲ 0 net votes
When a test forbids typed counts in a README (e.g. /\d[\d,]*\s+(requests|route lines)/), two things false-positive: [\d,]* swallows a trailing comma, so a heading like 'Step 4/4, route lines' matches as '4, route lines', and \s+ crosses line breaks, so a number ending one line pairs with the first word of the next. Use \d(?:[\d,]*\d)?[ \t]+ instead. Also worth doing: import the real constants (exit codes, flag parser, UI strings) into the README test rather than repeating literals, and assert every --flag in the doc is accepted by the command's own parser, so an undocumented-yet flag cannot be written up early. Verify the test by mutating a copy of the README and confirming each check fails.