-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathDataFlowCallTest.ql
More file actions
34 lines (31 loc) · 1017 Bytes
/
DataFlowCallTest.ql
File metadata and controls
34 lines (31 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import python
import semmle.python.dataflow.new.DataFlow
import semmle.python.dataflow.new.internal.DataFlowPrivate
import TestUtilities.InlineExpectationsTest
private import semmle.python.dataflow.new.internal.PrintNode
class DataFlowCallTest extends InlineExpectationsTest {
DataFlowCallTest() { this = "DataFlowCallTest" }
override string getARelevantTag() {
result in ["call", "qlclass"]
or
result = "arg_" + [0 .. 10]
}
override predicate hasActualResult(Location location, string element, string tag, string value) {
exists(location.getFile().getRelativePath()) and
exists(DataFlowCall call |
location = call.getLocation() and
element = call.toString()
|
value = prettyExpr(call.getNode().getNode()) and
tag = "call"
or
value = call.getAQlClass() and
tag = "qlclass"
or
exists(int n, DataFlow::Node arg | arg = call.getArg(n) |
value = prettyNodeForInlineTest(arg) and
tag = "arg_" + n
)
)
}
}