Fix #63.
This commit is contained in:
parent
8dceefd22c
commit
8215f02fec
2 changed files with 15 additions and 15 deletions
4
file.go
4
file.go
|
@ -182,8 +182,8 @@ func (f FileFilters) types() []string {
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Workaround for macOS bug: first type cannot be a four letter extension, so prepend empty string.
|
// Workaround for macOS bug: first type cannot be a four letter extension, so prepend dot string.
|
||||||
return append([]string{""}, res...)
|
return append([]string{"."}, res...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unix patterns are case-sensitive. Fold them if requested.
|
// Unix patterns are case-sensitive. Fold them if requested.
|
||||||
|
|
|
@ -91,21 +91,21 @@ func TestFileFilters_types(t *testing.T) {
|
||||||
want []string
|
want []string
|
||||||
}{
|
}{
|
||||||
{[]string{``}, nil},
|
{[]string{``}, nil},
|
||||||
{[]string{`*.png`}, []string{"", "png"}},
|
{[]string{`*.png`}, []string{".", "png"}},
|
||||||
{[]string{`*.pn?`}, nil},
|
{[]string{`*.pn?`}, nil},
|
||||||
{[]string{`*.pn;`}, []string{"", "pn;"}},
|
{[]string{`*.pn;`}, []string{".", "pn;"}},
|
||||||
{[]string{`*.pn\?`}, []string{"", "pn?"}},
|
{[]string{`*.pn\?`}, []string{".", "pn?"}},
|
||||||
{[]string{`*.[PpNnGg]`}, nil},
|
{[]string{`*.[PpNnGg]`}, nil},
|
||||||
{[]string{`*.[Pp][Nn][Gg]`}, []string{"", "PNG"}},
|
{[]string{`*.[Pp][Nn][Gg]`}, []string{".", "PNG"}},
|
||||||
{[]string{`*.[Pp][\Nn][G\g]`}, []string{"", "PNG"}},
|
{[]string{`*.[Pp][\Nn][G\g]`}, []string{".", "PNG"}},
|
||||||
{[]string{`*.[PNG`}, []string{"", "[PNG"}},
|
{[]string{`*.[PNG`}, []string{".", "[PNG"}},
|
||||||
{[]string{`*.]PNG`}, []string{"", "]PNG"}},
|
{[]string{`*.]PNG`}, []string{".", "]PNG"}},
|
||||||
{[]string{`*.[[]PNG`}, []string{"", "[PNG"}},
|
{[]string{`*.[[]PNG`}, []string{".", "[PNG"}},
|
||||||
{[]string{`*.[]]PNG`}, []string{"", "]PNG"}},
|
{[]string{`*.[]]PNG`}, []string{".", "]PNG"}},
|
||||||
{[]string{`*.[\[]PNG`}, []string{"", "[PNG"}},
|
{[]string{`*.[\[]PNG`}, []string{".", "[PNG"}},
|
||||||
{[]string{`*.[\]]PNG`}, []string{"", "]PNG"}},
|
{[]string{`*.[\]]PNG`}, []string{".", "]PNG"}},
|
||||||
{[]string{`public.png`}, []string{"", "public.png"}},
|
{[]string{`public.png`}, []string{".", "public.png"}},
|
||||||
{[]string{`-public-.png`}, []string{"", "png"}},
|
{[]string{`-public-.png`}, []string{".", "png"}},
|
||||||
}
|
}
|
||||||
for i, tt := range tests {
|
for i, tt := range tests {
|
||||||
filters := FileFilters{FileFilter{Patterns: tt.data}}
|
filters := FileFilters{FileFilter{Patterns: tt.data}}
|
||||||
|
|
Loading…
Reference in a new issue