From 2d0e0de553fc3c45d947a84526a6d11086a26bfd Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 28 Mar 2012 16:45:54 -0700 Subject: [PATCH] index: skip dirs stating with _, like _obj Change-Id: I6c12e2f2740e417fa3858f9872e7ea60843c4877 --- pkg/index/index_test.go | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pkg/index/index_test.go b/pkg/index/index_test.go index 64f01e156..fbc068d1f 100644 --- a/pkg/index/index_test.go +++ b/pkg/index/index_test.go @@ -127,18 +127,23 @@ func TestIndexerTestsCompleteness(t *testing.T) { if err != nil { t.Fatal(err) } -Files: + for _, file := range files { - if !file.IsDir() { + name := file.Name() + if !file.IsDir() || strings.HasPrefix(name, "_") || skipDir(name) { continue } - for _, v := range excludedDirs { - if file.Name() == v { - continue Files - } - } - if err = hasAllRequiredTests(file.Name(), t); err != nil { - t.Fatal(err) + if err := hasAllRequiredTests(name, t); err != nil { + t.Fatalf("dir %q missing tests: %v", err) } } } + +func skipDir(name string) bool { + for _, v := range excludedDirs { + if v == name { + return true + } + } + return false +}