File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -476,9 +476,9 @@ impl Pattern {
476
476
// invalid matches are treated literally
477
477
let is_valid =
478
478
// is the beginning of the pattern or begins with '/'
479
- if i == 2 || chars[ i - count - 1 ] == '/' {
479
+ if i == 2 || path :: is_separator ( chars[ i - count - 1 ] ) {
480
480
// it ends in a '/'
481
- if i < chars. len ( ) && chars[ i] == '/' {
481
+ if i < chars. len ( ) && path :: is_separator ( chars[ i] ) {
482
482
i += 1 ;
483
483
true
484
484
// or the pattern ends here
@@ -1242,4 +1242,10 @@ mod test {
1242
1242
// tests that / and \ are considered equivalent on windows
1243
1243
assert ! ( Pattern :: new( "a/b" ) . unwrap( ) . matches_path( & Path :: new( "a/b" ) ) ) ;
1244
1244
}
1245
+
1246
+ #[ test]
1247
+ fn test_path_join ( ) {
1248
+ let pattern = Path :: new ( "one" ) . join ( & Path :: new ( "**/*.rs" ) ) ;
1249
+ assert ! ( Pattern :: new( pattern. to_str( ) . unwrap( ) ) . is_ok( ) ) ;
1250
+ }
1245
1251
}
You can’t perform that action at this time.
0 commit comments