File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ impl PathOrPattern {
292
292
{
293
293
PathOrPattern :: new ( p)
294
294
} else {
295
- Ok ( PathOrPattern :: Path ( base. join ( p) ) )
295
+ Ok ( PathOrPattern :: Path ( normalize_path ( base. join ( p) ) ) )
296
296
}
297
297
}
298
298
@@ -581,6 +581,20 @@ mod test {
581
581
let err = PathOrPattern :: from_relative ( & cwd, "file:///raw.githubusercontent.com%2Fdyedgreen%2Fdeno-sqlite%2Frework_api%2Fmod.ts" ) . unwrap_err ( ) ;
582
582
assert_eq ! ( format!( "{:#}" , err) , "Invalid file URL 'file:///raw.githubusercontent.com%2Fdyedgreen%2Fdeno-sqlite%2Frework_api%2Fmod.ts'" ) ;
583
583
}
584
+ // sibling dir
585
+ {
586
+ let pattern = PathOrPattern :: from_relative ( & cwd, "../sibling" ) . unwrap ( ) ;
587
+ let parent_dir = cwd. parent ( ) . unwrap ( ) ;
588
+ assert_eq ! ( pattern. base_path( ) . unwrap( ) , parent_dir. join( "sibling" ) ) ;
589
+ assert_eq ! (
590
+ pattern. matches_path( & parent_dir. join( "sibling/foo.ts" ) ) ,
591
+ true
592
+ ) ;
593
+ assert_eq ! (
594
+ pattern. matches_path( & parent_dir. join( "./other/foo.js" ) ) ,
595
+ false
596
+ ) ;
597
+ }
584
598
}
585
599
586
600
#[ test]
You can’t perform that action at this time.
0 commit comments