Recognise imports of well-known testing frameworks.

This commit is contained in:
Max Schaefer
2020-04-09 09:40:53 +01:00
parent e30e5685b2
commit d5c8570bfc

View File

@@ -67,4 +67,19 @@ module TestFile {
private class FileContainingTestCases extends Range {
FileContainingTestCases() { this = any(TestCase tc).getFile() }
}
/** A file that imports a well-known testing framework. */
private class FileImportingTestingFramework extends Range {
FileImportingTestingFramework() {
exists(string pkg, ImportSpec is |
is.getPath() = pkg and
is.getFile() = this
|
pkg = "net/http/httptest" or
pkg = "gen/thrifttest" or
pkg = "github.com/onsi/ginkgo" or
pkg = "github.com/onsi/gomega"
)
}
}
}