mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Python: Move dataflow tests out of experimental
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# These are defined so that we can evaluate the test code.
|
||||
NONSOURCE = "not a source"
|
||||
SOURCE = "source"
|
||||
|
||||
|
||||
def is_source(x):
|
||||
return x == "source" or x == b"source" or x == 42 or x == 42.0 or x == 42j
|
||||
|
||||
|
||||
def SINK(x):
|
||||
if is_source(x):
|
||||
print("OK")
|
||||
else:
|
||||
print("Unexpected flow", x)
|
||||
|
||||
|
||||
def SINK_F(x):
|
||||
if is_source(x):
|
||||
print("Unexpected flow", x)
|
||||
else:
|
||||
print("OK")
|
||||
|
||||
import base
|
||||
|
||||
base.foo = 42
|
||||
|
||||
import m1
|
||||
|
||||
def test_const():
|
||||
SINK(m1.foo)
|
||||
|
||||
def test_overwritten():
|
||||
SINK(m1.bar)
|
||||
Reference in New Issue
Block a user