blob: fd45925a41e23797e3296949bc6484d830d75859 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package ignores
import "testing"
func TestShouldIgnore(t *testing.T) {
shouldIgnore := []string{
".git",
".jiri",
".hg",
"a/.git",
".git/a",
".git/.git",
".git/../.git",
}
shouldNotIgnore := []string{
"a",
"git",
"jiri",
"a/a",
"a/../a",
}
for _, si := range shouldIgnore {
if !Match(si) {
t.Errorf("%q should be ignored", si)
}
}
for _, sni := range shouldNotIgnore {
if Match(sni) {
t.Errorf("%q should not be ignored", sni)
}
}
}