Rework analyzer unit test to pass the go tip version (#318)

Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
Cosmin Cojocar 2019-05-17 15:35:46 +02:00 committed by GitHub
parent 9d9098fa97
commit 0ebfa2f8b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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