Files
codeql/swift/ql/test/TestUtils.qll
2022-07-29 16:48:45 +02:00

33 lines
727 B
Plaintext

private import codeql.swift.elements
cached
predicate toBeTested(Element e) {
e instanceof File
or
exists(ModuleDecl m |
not m.isBuiltinModule() and
not m.isSystemModule() and
(m = e or m.getInterfaceType() = e)
)
or
exists(Locatable loc |
loc.getLocation().getFile().getName().matches("%swift/ql/test%") and
(
e = loc
or
exists(Type t |
(e = t or e = t.(ExistentialType).getConstraint() or e = t.getCanonicalType()) and
(
t = loc.(ValueDecl).getInterfaceType()
or
t = loc.(NominalTypeDecl).getType()
or
t = loc.(VarDecl).getType()
or
t = loc.(Expr).getType()
)
)
)
)
}