From 0ebfa2f8b7f86a1cdf70f8dd3668ac583de9b302 Mon Sep 17 00:00:00 2001 From: Cosmin Cojocar Date: Fri, 17 May 2019 15:35:46 +0200 Subject: [PATCH] Rework analyzer unit test to pass the go tip version (#318) Signed-off-by: Cosmin Cojocar --- analyzer_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/analyzer_test.go b/analyzer_test.go index 80233a8..945c108 100644 --- a/analyzer_test.go +++ b/analyzer_test.go @@ -277,14 +277,18 @@ var _ = Describe("Analyzer", func() { pkg.AddFile("foo_test.go", ` package foo_test import "testing" + func test() error { + return nil + } func TestFoo(t *testing.T){ + test() }`) err := pkg.Build() Expect(err).ShouldNot(HaveOccurred()) err = customAnalyzer.Process(buildTags, pkg.Path) Expect(err).ShouldNot(HaveOccurred()) - _, metrics, _ := customAnalyzer.Report() - Expect(metrics.NumFiles).To(Equal(3)) + issues, _, _ := customAnalyzer.Report() + Expect(issues).Should(HaveLen(1)) }) })