Commit 7cbe02a
committed
Keep the checksum lint's regression corpus
The checksum lint took nineteen rounds of review. Every round was a definition
shape that slipped past it, and every fix was verified once, by hand, against a
scratch file that was then deleted — so the corpus survives only in dfcd595's
commit message. Nothing stops the next edit reintroducing any of them.
test/lint is that corpus, kept. Each case writes a fixture definition, calls
lint_checksums, and asserts on the `failures` array — the same array bin/ci's
summary reads, so a test can't pass on output that wouldn't fail the run.
Both directions are covered, because they aren't symmetric. A false negative
ships an unverified download silently, which is what the lint exists to prevent;
a false positive blocks CI over a URL nothing fetches, which is what gets checks
deleted. Twenty undigested forms must fail — every quoting style, continuations,
split mid-scheme, after if/&&/;/ANSI-C quoting/a multi-line string/a heredoc/a
quoted <<HIDE, attached ;echo/&&/|/), ?download=1, uppercase and wrong-length
digests. Reference links in comments and the savannah gitweb URLs must pass. And
a file with no archives at all must fail rather than pass over nothing.
Three things nothing else exercises: the archive extensions (.tar.xz, .tbz2,
.tar.Z, .zip are in the pattern but no definition uses them), join_continuations
itself (no definition has a line continuation), and the vacuous-pass guard.
bin/ci changes only enough to be sourceable: the dispatch moves into main(),
called only under `[ "${BASH_SOURCE[0]}" = "$0" ]`. Sourcing it currently cds,
prints a banner, runs all three lints over the sourcing script's arguments, and
can exit 1 out of the harness. The header comment is deliberately not renumbered
— --help re-reads lines 2-15 of the file.
bin/ci runs test/lint as well as syntax-checking and shellchecking it. Beyond
what the plan called for, and easy to drop, but a regression suite CI never
executes rots unnoticed, which is the failure mode this file exists to document.
Verified by mutation, since a suite that can't fail is worth nothing: dropping
.tar.xz from the pattern, joining continuations with a space, removing the
vacuous-pass guard, accepting uppercase digests, and classifying every URL as an
archive each fail the cases they should and no others.1 parent dfcd595 commit 7cbe02a
2 files changed
Lines changed: 381 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| |||
49 | 42 | | |
50 | 43 | | |
51 | 44 | | |
52 | | - | |
53 | | - | |
54 | 45 | | |
55 | 46 | | |
56 | 47 | | |
| |||
77 | 68 | | |
78 | 69 | | |
79 | 70 | | |
80 | | - | |
| 71 | + | |
81 | 72 | | |
82 | 73 | | |
83 | 74 | | |
| |||
176 | 167 | | |
177 | 168 | | |
178 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
179 | 189 | | |
180 | 190 | | |
181 | 191 | | |
| |||
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
197 | | - | |
| 207 | + | |
198 | 208 | | |
199 | 209 | | |
200 | 210 | | |
| |||
222 | 232 | | |
223 | 233 | | |
224 | 234 | | |
225 | | - | |
| 235 | + | |
| 236 | + | |
226 | 237 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
231 | 242 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 243 | + | |
238 | 244 | | |
239 | | - | |
| 245 | + | |
240 | 246 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
246 | 270 | | |
247 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
248 | 276 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
254 | 285 | | |
0 commit comments