Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 729be1d

Browse files
committed
feat: add tests for longest path match
1 parent d862cfd commit 729be1d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/test/paths.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ describe('paths', () => {
5555
}),
5656
'file:///app/source.php'
5757
);
58+
// longest
59+
assert.equal(
60+
convertClientPathToDebugger('/home/felix/mysource/subdir/source.php', {
61+
'/var/www': '/home/felix/mysite',
62+
'/app': '/home/felix/mysource',
63+
'/app/subdir1': '/home/felix/mysource/subdir',
64+
}),
65+
'file:///app/subdir1/source.php'
66+
);
5867
});
5968
// unix to windows
6069
it('should convert a unix path to a windows URI', () => {
@@ -165,6 +174,15 @@ describe('paths', () => {
165174
}),
166175
'/home/felix/mysource/source.php'
167176
);
177+
// longest
178+
assert.equal(
179+
convertDebuggerPathToClient('file:///app/subdir/source.php', {
180+
'/var/www': '/home/felix/mysite',
181+
'/app': '/home/felix/mysource',
182+
'/app/subdir': '/home/felix/mysource/subdir1',
183+
}),
184+
'/home/felix/mysource/subdir1/source.php'
185+
);
168186
});
169187
// unix to windows
170188
(process.platform === 'win32' ? it : it.skip)('should map unix uris to windows paths', () => {

0 commit comments

Comments
 (0)