mirror of
https://github.com/github/codeql.git
synced 2026-01-30 23:02:56 +01:00
Fix recognition of Test, Benchmark, and Example as test cases.
This commit is contained in:
@@ -27,15 +27,15 @@ module TestCase {
|
||||
/** A `go test` style test (including benchmarks and examples). */
|
||||
private class GoTestFunction extends Range, FuncDef {
|
||||
GoTestFunction() {
|
||||
getName().regexpMatch("Test[^a-z].*") and
|
||||
getName().regexpMatch("Test(?![a-z]).*") and
|
||||
getNumParameter() = 1 and
|
||||
getParameter(0).getType().(PointerType).getBaseType().hasQualifiedName("testing", "T")
|
||||
or
|
||||
getName().regexpMatch("Benchmark[^a-z].*") and
|
||||
getName().regexpMatch("Benchmark(?![a-z]).*") and
|
||||
getNumParameter() = 1 and
|
||||
getParameter(0).getType().(PointerType).getBaseType().hasQualifiedName("testing", "B")
|
||||
or
|
||||
getName().regexpMatch("Example[^a-z].*") and
|
||||
getName().regexpMatch("Example(?![a-z]).*") and
|
||||
getNumParameter() = 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user