26 lines
784 B
JavaScript
26 lines
784 B
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
|
|
import { parseGitStatusPorcelainZ } from '../scripts/git-porcelain-paths.mjs';
|
|
|
|
test('changed-scope parser preserves spaces and unicode without git status prefixes', () => {
|
|
const output = [
|
|
' M release-gate/report.mjs',
|
|
'?? docs/发包必看.md',
|
|
'A docs/file with spaces.md',
|
|
'',
|
|
].join('\0');
|
|
assert.deepEqual(parseGitStatusPorcelainZ(output), [
|
|
'release-gate/report.mjs',
|
|
'docs/发包必看.md',
|
|
'docs/file with spaces.md',
|
|
]);
|
|
});
|
|
|
|
test('changed-scope parser uses the rename destination and skips the source entry', () => {
|
|
assert.deepEqual(
|
|
parseGitStatusPorcelainZ('R docs/new.md\0docs/old.md\0 M package.json\0'),
|
|
['docs/new.md', 'package.json'],
|
|
);
|
|
});
|