mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Add test
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
def test_conditoinal_function(cond):
|
||||
def foo():
|
||||
return "foo"
|
||||
|
||||
def bar():
|
||||
return "bar"
|
||||
|
||||
if cond:
|
||||
f = foo
|
||||
else:
|
||||
f = bar
|
||||
|
||||
sink = f()
|
||||
return sink
|
||||
|
||||
|
||||
f_false = test_conditoinal_function(False)
|
||||
f_true = test_conditoinal_function(True)
|
||||
|
||||
|
||||
def foo():
|
||||
return "foo"
|
||||
|
||||
|
||||
def test_redefinition():
|
||||
f = foo
|
||||
|
||||
def foo():
|
||||
return "refined"
|
||||
|
||||
sink = f()
|
||||
return sink
|
||||
Reference in New Issue
Block a user