()
| 52 | * @returns {{ id: string, input: string }[]} every Data-state tokenizer input |
| 53 | */ |
| 54 | const loadTokenizerCases = () => { |
| 55 | const cases = []; |
| 56 | for (const file of fs.readdirSync(tokenizerDir)) { |
| 57 | if (!file.endsWith(".test") || SKIP_FILES.has(file)) continue; |
| 58 | const data = JSON.parse( |
| 59 | fs.readFileSync(path.join(tokenizerDir, file), "utf8") |
| 60 | ); |
| 61 | let index = 0; |
| 62 | for (const t of data.tests || []) { |
| 63 | if (!(t.initialStates || ["Data state"]).includes("Data state")) continue; |
| 64 | const input = t.doubleEscaped ? unescape(t.input) : t.input; |
| 65 | cases.push({ id: `${file} #${index}`, input }); |
| 66 | index++; |
| 67 | } |
| 68 | } |
| 69 | return cases; |
| 70 | }; |
| 71 | |
| 72 | /** |
| 73 | * Compile a batch of inputs as separate HTML entries in one compilation. |
no test coverage detected