mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 03:55:54 +00:00
Change the issue test to verify that a multi-line finding contains a line range
Signed-off-by: Cosmin Cojocar <cosmin.cojocar@gmx.ch>
This commit is contained in:
parent
7aedcc56ab
commit
7da9248ce6
1 changed files with 3 additions and 2 deletions
|
@ -98,7 +98,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
)
|
)
|
||||||
func main() {
|
func main() {
|
||||||
_, _ := net.Listen("tcp", "0.0.0.0:2000")
|
_, _ := net.Listen("tcp",
|
||||||
|
"0.0.0.0:2000")
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
pkg := testutils.NewTestPackage()
|
pkg := testutils.NewTestPackage()
|
||||||
|
@ -122,7 +123,7 @@ func main() {
|
||||||
Expect(err).ShouldNot(HaveOccurred())
|
Expect(err).ShouldNot(HaveOccurred())
|
||||||
Expect(issue).ShouldNot(BeNil())
|
Expect(issue).ShouldNot(BeNil())
|
||||||
Expect(issue.File).Should(MatchRegexp("foo.go"))
|
Expect(issue.File).Should(MatchRegexp("foo.go"))
|
||||||
Expect(issue.Line).Should(MatchRegexp("7"))
|
Expect(issue.Line).Should(MatchRegexp("7-8"))
|
||||||
Expect(issue.Col).Should(Equal("10"))
|
Expect(issue.Col).Should(Equal("10"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue