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 {
476476 // invalid matches are treated literally
477477 let is_valid =
478478 // 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 ] ) {
480480 // it ends in a '/'
481- if i < chars. len ( ) && chars[ i] == '/' {
481+ if i < chars. len ( ) && path :: is_separator ( chars[ i] ) {
482482 i += 1 ;
483483 true
484484 // or the pattern ends here
@@ -1242,4 +1242,10 @@ mod test {
12421242 // tests that / and \ are considered equivalent on windows
12431243 assert ! ( Pattern :: new( "a/b" ) . unwrap( ) . matches_path( & Path :: new( "a/b" ) ) ) ;
12441244 }
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+ }
12451251}
You can’t perform that action at this time.
0 commit comments