filebrowser/rules/rules_test.go
Tiger Nie b78665b46b
Update rules/rules_test.go
test naming convention

Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
2020-11-18 22:37:09 +08:00

24 lines
504 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 != truth {
t.Errorf("MatchHidden(%s)=%v; want %v", path, got, truth)
}
}
}