mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Python: Add test of multi func def based on runtime decision
This commit is contained in:
@@ -15,6 +15,8 @@ pointsTo_found_typeTracker_notFound
|
||||
| code/func_defined_outside_class.py:42:1:42:7 | ControlFlowNode for Attribute() | B._gen.func |
|
||||
| code/func_defined_outside_class.py:43:1:43:7 | ControlFlowNode for Attribute() | B._gen.func |
|
||||
| code/funky_regression.py:15:9:15:17 | ControlFlowNode for Attribute() | Wat.f2 |
|
||||
| code/runtime_decision.py:44:1:44:7 | ControlFlowNode for func4() | "code/runtime_decision_defns.py:4:func4" |
|
||||
| code/runtime_decision.py:44:1:44:7 | ControlFlowNode for func4() | "code/runtime_decision_defns.py:7:func4" |
|
||||
| code/type_tracking_limitation.py:8:1:8:3 | ControlFlowNode for x() | my_func |
|
||||
typeTracker_found_pointsTo_notFound
|
||||
| code/callable_as_argument.py:29:5:29:12 | ControlFlowNode for Attribute() | test_class.InsideTestFunc.sm |
|
||||
|
||||
@@ -24,3 +24,21 @@ else:
|
||||
func2 = rd_bar
|
||||
|
||||
func2() # $ pt,tt=rd_foo pt,tt=rd_bar
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
# definition is random
|
||||
|
||||
if random.random() < 0.5:
|
||||
def func3():
|
||||
print("func3 A")
|
||||
else:
|
||||
def func3():
|
||||
print("func3 B")
|
||||
|
||||
func3() # $ pt,tt=33:func3 pt,tt=36:func3
|
||||
|
||||
|
||||
# func4 uses same setup as func3, it's just defined in an other file
|
||||
from code.runtime_decision_defns import func4
|
||||
func4() # $ pt="code/runtime_decision_defns.py:4:func4" pt="code/runtime_decision_defns.py:7:func4" MISSING: tt
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import random
|
||||
|
||||
if random.random() < 0.5:
|
||||
def func4():
|
||||
print("func4 A")
|
||||
else:
|
||||
def func4():
|
||||
print("func4 B")
|
||||
Reference in New Issue
Block a user