Skip to content

Commit e5fdeae

Browse files
committed
Python: Add return (func_ref, ...) test
1 parent fb0cc18 commit e5fdeae

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

python/ql/test/experimental/library-tests/CallGraph/InlineCallGraphTest.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pointsTo_found_typeTracker_notFound
1717
| code/funky_regression.py:15:9:15:17 | ControlFlowNode for Attribute() | Wat.f2 |
1818
| code/runtime_decision.py:44:1:44:7 | ControlFlowNode for func4() | "code/runtime_decision_defns.py:4:func4" |
1919
| code/runtime_decision.py:44:1:44:7 | ControlFlowNode for func4() | "code/runtime_decision_defns.py:7:func4" |
20+
| code/tuple_function_return.py:15:1:15:4 | ControlFlowNode for f2() | func |
2021
| code/type_tracking_limitation.py:8:1:8:3 | ControlFlowNode for x() | my_func |
2122
typeTracker_found_pointsTo_notFound
2223
| code/callable_as_argument.py:29:5:29:12 | ControlFlowNode for Attribute() | test_class.InsideTestFunc.sm |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def func():
2+
print("func()")
3+
4+
def return_func():
5+
return func
6+
7+
def return_func_in_tuple():
8+
return (func, 42)
9+
10+
f1 = return_func() # $ pt,tt=return_func
11+
f1() # $ pt,tt=func
12+
13+
14+
f2, _ = return_func_in_tuple() # $ pt,tt=return_func_in_tuple
15+
f2() # $ pt=func MISSING: tt

0 commit comments

Comments
 (0)