Python: Expand dict update tests

This commit is contained in:
Rasmus Wriedt Larsen
2024-02-23 14:59:07 +01:00
parent dac2b57bb0
commit 0cf3fe4a4c
2 changed files with 15 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ pointsTo_found_typeTracker_notFound
| code/func_defined_outside_class.py:39:11:39:21 | ControlFlowNode for _gen() | B._gen |
| 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/func_ref_in_content.py:17:1:17:4 | ControlFlowNode for f2() | func |
| code/func_ref_in_content.py:20:1:20:4 | ControlFlowNode for f2() | func |
| code/funky_regression.py:15:9:15:17 | ControlFlowNode for Attribute() | Wat.f2 |
| code/type_tracking_limitation.py:8:1:8:3 | ControlFlowNode for x() | my_func |
typeTracker_found_pointsTo_notFound
@@ -38,8 +38,10 @@ typeTracker_found_pointsTo_notFound
| code/class_super.py:101:1:101:7 | ControlFlowNode for Attribute() | Z.foo |
| code/class_super.py:108:1:108:8 | ControlFlowNode for Attribute() | Z.foo |
| code/def_in_function.py:22:5:22:11 | ControlFlowNode for Attribute() | test.A.foo |
| code/func_ref_in_content.py:29:1:29:4 | ControlFlowNode for f4() | func |
| code/func_ref_in_content.py:40:1:40:4 | ControlFlowNode for f5() | func |
| code/func_ref_in_content.py:32:1:32:4 | ControlFlowNode for f4() | func |
| code/func_ref_in_content.py:46:1:46:4 | ControlFlowNode for f5() | func |
| code/func_ref_in_content.py:48:1:48:15 | ControlFlowNode for Subscript() | func2 |
| code/func_ref_in_content.py:50:1:50:19 | ControlFlowNode for Subscript() | func2 |
| code/isinstance.py:9:13:9:22 | ControlFlowNode for Attribute() | A.foo |
| code/isinstance.py:9:13:9:22 | ControlFlowNode for Attribute() | ASub.foo |
| code/isinstance.py:14:13:14:22 | ControlFlowNode for Attribute() | A.foo |

View File

@@ -1,6 +1,9 @@
def func():
print("func()")
def func2():
print("func2()")
def return_func():
return func
@@ -32,6 +35,9 @@ f4() # $ tt=func
def return_func_in_dict_update():
d = {}
d["func"] = func
d["func2"] = func2
d["contested"] = func
d["contested"] = func2
return d
dct2 = return_func_in_dict_update() # $ pt,tt=return_func_in_dict_update
@@ -39,6 +45,10 @@ dct2 = return_func_in_dict_update() # $ pt,tt=return_func_in_dict_update
f5 = dct2['func']
f5() # $ tt=func
dct2['func2']() # $ tt=func2
dct2['contested']() # $ tt=func2 SPURIOUS: tt=func
def return_func_in_list():
return [func, 42]