refactor(plan): K6 keeps its own normaliser and LIST_ITEM is a literal again
Operator decision 27 (13.10); review finding 7961a700. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
bcf3adbba7
commit
1786df999e
3 changed files with 16 additions and 8 deletions
|
|
@ -15,7 +15,7 @@ import { buildPlan } from '../helpers/plan-v18-builder.mjs';
|
|||
import { plannedPaths } from '../../lib/verification/plan-scope-sweep.mjs';
|
||||
import { childEnv } from '../helpers/child-env.mjs';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
|
||||
import { mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
|
@ -200,6 +200,15 @@ test('below 1.9: K6 plans what it planned before - the same input plans both pat
|
|||
assert.deepEqual(plannedPaths(tf), ['src/mod2.mjs', 'src/parse.mjs', 'tests/a.test.mjs', 'tests/mod2.test.mjs']);
|
||||
});
|
||||
|
||||
test('decision 27 — K6 keeps its own norm and LIST_ITEM is a literal', () => {
|
||||
const sweep = readFileSync(join(ROOT, 'lib', 'verification', 'plan-scope-sweep.mjs'), 'utf8');
|
||||
assert.doesNotMatch(sweep, /\bnormPlanPath\b/, 'K6 does not import the parser\'s normaliser');
|
||||
assert.ok(sweep.includes("const norm = p => p.replace(/\\\\/g, '/').replace(/^\\.\\//, '');"), 'K6 keeps its own norm line');
|
||||
const parser = readFileSync(join(ROOT, 'lib', 'parsers', 'plan-schema.mjs'), 'utf8');
|
||||
assert.doesNotMatch(parser, /\bLIST_MARKER\b/, 'LIST_ITEM is not built from LIST_MARKER');
|
||||
assert.ok(parser.includes('const LIST_ITEM = /^\\s*(?:[-*+]|\\d+[.)])\\s+/;'), 'LIST_ITEM is the literal');
|
||||
});
|
||||
|
||||
test('1.9: the red proof\'s tests_only reads Files by the grammar (CLI, temp git repo); 1.8 reads it as before', () => {
|
||||
const repo = mkdtempSync(join(tmpdir(), 'plan19-redproof-'));
|
||||
const git = (...args) => spawnSync('git', args, { cwd: repo, encoding: 'utf8', env: childEnv() });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue