mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-06 02:49:56 +00:00
test(swift): cover valid prefix before later partial match
This commit is contained in:
parent
d449fc3b5a
commit
b73dd1f3c5
1 changed files with 10 additions and 0 deletions
|
|
@ -12,6 +12,16 @@ describe('groupSwiftFilesBySpmTarget', () => {
|
|||
expect(groups.get('__default__')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('keeps an earlier segment-aligned match when a later occurrence is partial', () => {
|
||||
const targets = new Map([['Core', 'Modules/Core']]);
|
||||
const items = ['Modules/Core/Thing/SubModules/Core/Thing.swift'];
|
||||
|
||||
const groups = groupSwiftFilesBySpmTarget(items, (item) => item, targets);
|
||||
|
||||
expect(groups.get('Core')).toEqual(items);
|
||||
expect(groups.get('__default__')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('does not treat a partial path segment as a target match', () => {
|
||||
const targets = new Map([['Core', 'Modules/Core']]);
|
||||
const item = 'vendor/SubModules/Core/Thing.swift';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue