@@ -99,7 +99,7 @@ var matchTests = []MatchTest{
99
99
{"[abc]" , "b" , true , true , nil , false , false , true , true , 3 , 3 },
100
100
{"**" , "" , true , true , nil , false , false , false , false , 38 , 38 },
101
101
{"a/**" , "a" , true , true , nil , false , false , false , true , 7 , 7 },
102
- {"a/**/" , "a" , true , true , nil , false , false , false , false , 4 , 4 },
102
+ {"a/**/" , "a" , true , true , nil , false , false , false , true , 4 , 4 },
103
103
{"a/**" , "a/" , true , true , nil , false , false , false , false , 7 , 7 },
104
104
{"a/**/" , "a/" , true , true , nil , false , false , false , false , 4 , 4 },
105
105
{"a/**" , "a/b" , true , true , nil , false , false , false , true , 7 , 7 },
@@ -509,7 +509,10 @@ func doFilepathGlobTest(t *testing.T, opts ...GlobOption) {
509
509
os .Chdir ("test" )
510
510
511
511
for idx , tt := range matchTests {
512
- if tt .testOnDisk {
512
+ // Patterns ending with a slash are treated semantically different by
513
+ // FilepathGlob vs Glob because FilepathGlob runs filepath.Clean, which
514
+ // will remove the trailing slash.
515
+ if tt .testOnDisk && ! strings .HasSuffix (tt .pattern , "/" ) {
513
516
ttmod := tt
514
517
ttmod .pattern = filepath .FromSlash (tt .pattern )
515
518
ttmod .testPath = filepath .FromSlash (tt .testPath )
0 commit comments