mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Python: Move dataflow tests out of experimental
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import python
|
||||
import semmle.python.dataflow.new.DataFlow
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
module GlobalReadTest implements TestSig {
|
||||
string getARelevantTag() { result = "reads" }
|
||||
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(DataFlow::ModuleVariableNode n, DataFlow::Node read |
|
||||
read = n.getARead() and
|
||||
value = n.getVariable().getId() and
|
||||
value != "print" and
|
||||
tag = "reads" and
|
||||
location = read.getLocation() and
|
||||
element = read.toString()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
module GlobalWriteTest implements TestSig {
|
||||
string getARelevantTag() { result = "writes" }
|
||||
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(DataFlow::ModuleVariableNode n, DataFlow::Node read |
|
||||
read = n.getAWrite() and
|
||||
value = n.getVariable().getId() and
|
||||
tag = "writes" and
|
||||
location = read.getLocation() and
|
||||
element = read.toString()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<MergeTests<GlobalReadTest, GlobalWriteTest>>
|
||||
Reference in New Issue
Block a user