mirror of
https://github.com/github/codeql.git
synced 2026-02-07 18:51:06 +01:00
add callgraph test
This commit is contained in:
committed by
GitHub
parent
068c57acdd
commit
c8d0384907
15
ql/test/callgraph/Foo.qll
Normal file
15
ql/test/callgraph/Foo.qll
Normal file
@@ -0,0 +1,15 @@
|
||||
import ql
|
||||
|
||||
predicate foo() { none() }
|
||||
|
||||
query predicate test() { foo() }
|
||||
|
||||
class Foo extends AstNode {
|
||||
predicate bar() { none() }
|
||||
|
||||
predicate baz() { bar() }
|
||||
}
|
||||
|
||||
class Sub extends Foo {
|
||||
override predicate baz() { super.baz() }
|
||||
}
|
||||
3
ql/test/callgraph/callgraph.expected
Normal file
3
ql/test/callgraph/callgraph.expected
Normal file
@@ -0,0 +1,3 @@
|
||||
| Foo.qll:5:26:5:30 | PredicateCall | Foo.qll:3:1:3:26 | foo |
|
||||
| Foo.qll:10:21:10:25 | PredicateCall | Foo.qll:8:3:8:28 | ClassPredicate |
|
||||
| Foo.qll:14:30:14:40 | MemberCall | Foo.qll:10:3:10:27 | ClassPredicate |
|
||||
3
ql/test/callgraph/callgraph.ql
Normal file
3
ql/test/callgraph/callgraph.ql
Normal file
@@ -0,0 +1,3 @@
|
||||
import ql
|
||||
|
||||
query AstNode getTarget(Call call) { result = call.getTarget().getDeclaration() }
|
||||
Reference in New Issue
Block a user