mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
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:
parent
9d9098fa97
commit
0ebfa2f8b7
1 changed files with 6 additions and 2 deletions
|
@ -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))
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue