* Zahlen ueber Tests, die die LEBENDE Doku behauptet. * * Gesucht wird eine Zahl unmittelbar vor einem Testwort, in allen verfolgten * Markdown-Dateien dieses Projekts (der cbm-Klon ist fremder Text und * gitignoriert), ausser in den datierten Protokollen unter verification/. * Findet der Scan
()
| 417 | * blinder Fleck. |
| 418 | */ |
| 419 | async function documentedTestClaims() { |
| 420 | const claims = []; |
| 421 | const skippedProtocols = []; |
| 422 | const files = (await git(['ls-files', '*.md'])).split('\n') |
| 423 | .map((line) => line.trim()) |
| 424 | .filter(Boolean); |
| 425 | const pattern = /(\d+)\s+(?:eingefrorene\s+|gruene\s+)?(?:Abnahme-?|Unit-?|Scaffold-?|Akzeptanz-?)?[Tt]ests?\b/; |
| 426 | for (const file of files) { |
| 427 | const text = await textOf(file); |
| 428 | if (text === null) { |
| 429 | continue; |
| 430 | } |
| 431 | const isProtocol = file.startsWith(PROTOCOL_PREFIX); |
| 432 | const lines = text.split('\n'); |
| 433 | for (let index = 0; index < lines.length; index += 1) { |
| 434 | const match = pattern.exec(lines[index]); |
| 435 | if (match === null) { |
| 436 | continue; |
| 437 | } |
| 438 | const where = { |
| 439 | file, |
| 440 | line: index + 1, |
| 441 | claimed: Number(match[1]), |
| 442 | text: lines[index].trim().slice(0, 160), |
| 443 | }; |
| 444 | if (isProtocol) { |
| 445 | skippedProtocols.push(where); |
| 446 | } else { |
| 447 | claims.push(where); |
| 448 | } |
| 449 | } |
| 450 | } |
| 451 | return { claims, skippedProtocols }; |
| 452 | } |
| 453 | |
| 454 | async function main() { |
| 455 | const totalStarted = Date.now(); |