diff --git a/analyzer_test.go b/analyzer_test.go index 1afac2f..7d6ba9b 100644 --- a/analyzer_test.go +++ b/analyzer_test.go @@ -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() @@ -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() {