fix(plan): a list joiner no longer ends the read of a plain path below 1.9
Review finding 182ceb93. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ed6699da58
commit
6b8b0e3f2a
2 changed files with 16 additions and 3 deletions
|
|
@ -10,7 +10,7 @@ import { test } from 'node:test';
|
|||
import { strict as assert } from 'node:assert';
|
||||
import { buildPlan } from '../helpers/plan-v18-builder.mjs';
|
||||
import { validatePlanContent } from '../../lib/validators/plan-validator.mjs';
|
||||
import { stepTestsOnly } from '../../lib/parsers/plan-schema.mjs';
|
||||
import { stepTestsOnly, untickedPaths } from '../../lib/parsers/plan-schema.mjs';
|
||||
|
||||
const step = (files) => `- **Files:** ${files}\n- **Changes:** x\n`;
|
||||
|
||||
|
|
@ -49,6 +49,14 @@ const CONTROLS = [
|
|||
'`tests/a.test.mjs` — covers `parse`, `Parser`, `ParseError`', ['tests/a.test.mjs']],
|
||||
['B\'s neighbour: a plain path right after the backticked one is read',
|
||||
'`tests/a.test.mjs` src/b.mjs', ['tests/a.test.mjs', 'src/b.mjs']],
|
||||
['B\'s neighbour: a plain path after backticked paths joined by "+" is read',
|
||||
'`src/a.mjs` + `src/b.mjs` src/c.mjs', ['src/a.mjs', 'src/b.mjs', 'src/c.mjs']],
|
||||
['B\'s neighbour: a plain path after backticked paths joined by "&" is read',
|
||||
'`src/a.mjs` & `src/b.mjs` src/c.mjs', ['src/a.mjs', 'src/b.mjs', 'src/c.mjs']],
|
||||
['B\'s neighbour: a plain path after backticked paths joined by "and" is read',
|
||||
'`src/a.mjs` and `src/b.mjs` src/c.mjs', ['src/a.mjs', 'src/b.mjs', 'src/c.mjs']],
|
||||
['B\'s neighbour: a plain source path after two joined test paths makes the step no tests-only step',
|
||||
'`tests/a.test.mjs` + `tests/b.test.mjs` src/c.mjs', ['tests/a.test.mjs', 'tests/b.test.mjs', 'src/c.mjs']],
|
||||
];
|
||||
|
||||
for (const [name, files, paths] of CONTROLS) {
|
||||
|
|
@ -59,3 +67,7 @@ for (const [name, files, paths] of CONTROLS) {
|
|||
`PLAN_STEP_TESTS_ONLY ${testsOnly ? 'fires' : 'stays quiet'} on a 1.8 plan: ${files}`);
|
||||
});
|
||||
}
|
||||
|
||||
test('6.4 / control: untickedPaths names the plain path after backticked paths joined by "+"', () => {
|
||||
assert.deepEqual(untickedPaths('`src/a.mjs` + `src/b.mjs` src/c.mjs'), ['src/c.mjs']);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue