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)
|
|
}
|
|
}
|
|
}
|