@@ -21,18 +21,36 @@ describe('URI Utils', () => {
2121 expect ( UriUtils . relative ( from , to ) ) . toBe ( '../d.txt' ) ;
2222 } ) ;
2323
24+ test . skipIf ( process . platform !== 'win32' ) ( 'relative path in parent directory win32' , ( ) => {
25+ const from = URI . file ( 'c:\\a\\b' ) ;
26+ const to = URI . file ( 'c:\\a\\d.txt' ) ;
27+ expect ( UriUtils . relative ( from , to ) ) . toBe ( '../d.txt' ) ;
28+ } ) ;
29+
2430 test ( 'relative path in sub directory' , ( ) => {
2531 const from = URI . file ( '/a' ) ;
2632 const to = URI . file ( '/a/b/c.txt' ) ;
2733 expect ( UriUtils . relative ( from , to ) ) . toBe ( 'b/c.txt' ) ;
2834 } ) ;
2935
36+ test . skipIf ( process . platform !== 'win32' ) ( 'relative path in sub directory win32' , ( ) => {
37+ const from = URI . file ( 'c:\\a' ) ;
38+ const to = URI . file ( 'c:\\a\\b\\c.txt' ) ;
39+ expect ( UriUtils . relative ( from , to ) ) . toBe ( 'b/c.txt' ) ;
40+ } ) ;
41+
3042 test ( 'relative path in other directory' , ( ) => {
3143 const from = URI . file ( '/a/b' ) ;
3244 const to = URI . file ( '/a/c/d.txt' ) ;
3345 expect ( UriUtils . relative ( from , to ) ) . toBe ( '../c/d.txt' ) ;
3446 } ) ;
3547
48+ test . skipIf ( process . platform !== 'win32' ) ( 'relative path in other directory win32' , ( ) => {
49+ const from = URI . file ( 'c:\\a\\b' ) ;
50+ const to = URI . file ( 'c:\\a\\c\\d.txt' ) ;
51+ expect ( UriUtils . relative ( from , to ) ) . toBe ( '../c/d.txt' ) ;
52+ } ) ;
53+
3654 test ( 'Equal uris are equal' , ( ) => {
3755 const uri1 = 'file:///a/b' ;
3856 const uri2 = 'file:///a/b' ;
0 commit comments