feat: add hide dotfiles param (#1148)

This commit is contained in:
Tiger Nie
2020-11-20 18:51:28 +08:00
committed by GitHub
parent dcbc3286e2
commit 10e399b3c3
8 changed files with 55 additions and 11 deletions

23
rules/rules_test.go Normal file
View File

@@ -0,0 +1,23 @@
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)
}
}
}