@@ -27,6 +27,24 @@ describe('URI Utils', () => {
2727 expect ( UriUtils . relative ( from , to ) ) . toBe ( '../d.txt' ) ;
2828 } ) ;
2929
30+ test . skipIf ( process . platform !== 'win32' ) ( 'relative path in parent directory win32, uppercase drive letters' , ( ) => {
31+ const from = URI . file ( 'C:\\a\\b' ) ;
32+ const to = URI . file ( 'C:\\a\\d.txt' ) ;
33+ expect ( UriUtils . relative ( from , to ) ) . toBe ( '../d.txt' ) ;
34+ } ) ;
35+
36+ test . skipIf ( process . platform !== 'win32' ) ( 'relative path in parent directory win32, mixed drive letter cases 1' , ( ) => {
37+ const from = URI . file ( 'C:\\a\\b' ) ;
38+ const to = URI . file ( 'c:\\a\\d.txt' ) ;
39+ expect ( UriUtils . relative ( from , to ) ) . toBe ( '../d.txt' ) ;
40+ } ) ;
41+
42+ test . skipIf ( process . platform !== 'win32' ) ( 'relative path in parent directory win32, mixed drive letter cases 2' , ( ) => {
43+ const from = URI . file ( 'c:\\a\\b' ) ;
44+ const to = URI . file ( 'C:\\a\\d.txt' ) ;
45+ expect ( UriUtils . relative ( from , to ) ) . toBe ( '../d.txt' ) ;
46+ } ) ;
47+
3048 test ( 'relative path in sub directory' , ( ) => {
3149 const from = URI . file ( '/a' ) ;
3250 const to = URI . file ( '/a/b/c.txt' ) ;
@@ -51,6 +69,12 @@ describe('URI Utils', () => {
5169 expect ( UriUtils . relative ( from , to ) ) . toBe ( '../c/d.txt' ) ;
5270 } ) ;
5371
72+ test . skipIf ( process . platform !== 'win32' ) ( 'different win32 drive letters' , ( ) => {
73+ const from = URI . file ( 'c:\\a\\b' ) ;
74+ const to = URI . file ( 'D:\\a\\c\\d.txt' ) ;
75+ expect ( UriUtils . relative ( from , to ) ) . toBe ( 'D:/a/c/d.txt' ) ;
76+ } ) ;
77+
5478 test ( 'Equal uris are equal' , ( ) => {
5579 const uri1 = 'file:///a/b' ;
5680 const uri2 = 'file:///a/b' ;
0 commit comments