mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
24 lines
502 B
Go
24 lines
502 B
Go
package rules
|
|
|
|
import "testing"
|
|
|
|
func TestMatchHidden(t *testing.T) {
|
|
cases := map[string]bool{
|
|
"/": false,
|
|
"/src": false,
|
|
"/src/": false,
|
|
"/.circleci": true,
|
|
"/a/b/c/.docker.json": true,
|
|
".docker.json": true,
|
|
"Dockerfile": false,
|
|
"/Dockerfile": false,
|
|
}
|
|
|
|
for path, want := range cases {
|
|
got := MatchHidden(path)
|
|
if got != want {
|
|
t.Errorf("MatchHidden(%s)=%v; want %v", path, got, want)
|
|
}
|
|
}
|
|
}
|