Skip to content

Commit

Permalink
Add tests for an empty package without any test file
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
  • Loading branch information
ccojocar authored and Cosmin Cojocar committed May 1, 2019
1 parent 76b2c12 commit bac6f0f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ var _ = Describe("Analyzer", func() {
Expect(err).Should(HaveOccurred())
})

It("should process an empty package", func() {
It("should process an empty package with test file", func() {
analyzer.LoadRules(rules.Generate().Builders())
pkg := testutils.NewTestPackage()
defer pkg.Close()
Expand All @@ -243,6 +243,13 @@ var _ = Describe("Analyzer", func() {
err = analyzer.Process(buildTags, pkg.Path)
Expect(err).ShouldNot(HaveOccurred())
})
It("should report an error when the package is empty", func() {
analyzer.LoadRules(rules.Generate().Builders())
pkg := testutils.NewTestPackage()
defer pkg.Close()
err := analyzer.Process(buildTags, pkg.Path)
Expect(err).Should(HaveOccurred())
})
})

It("should be possible to overwrite nosec comments, and report issues", func() {
Expand Down

0 comments on commit bac6f0f

Please sign in to comment.