File tree Expand file tree Collapse file tree
python/ql/test/experimental/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -726,15 +726,15 @@ def f6(arg):
726726 return f5 (arg )
727727
728728 x = f6 (SOURCE )
729- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
729+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
730730 x = f5 (SOURCE )
731- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
731+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
732732 x = f4 (SOURCE )
733- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
733+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
734734 x = f3 (SOURCE )
735- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
735+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
736736 x = f2 (SOURCE )
737- SINK (x ) #$ MISSING: flow="SOURCE, l:-1 -> x"
737+ SINK (x ) #$ flow="SOURCE, l:-1 -> x"
738738 x = f1 (SOURCE )
739739 SINK (x ) #$ flow="SOURCE, l:-1 -> x"
740740
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ module_attr_tracker
66| import_as_attr.py:1:28:1:35 | GSSA Variable attr_ref |
77| import_as_attr.py:3:1:3:1 | GSSA Variable x |
88| import_as_attr.py:3:5:3:12 | ControlFlowNode for attr_ref |
9+ | import_as_attr.py:5:1:5:10 | GSSA Variable attr_ref |
910| import_as_attr.py:6:5:6:5 | SSA variable y |
1011| import_as_attr.py:6:9:6:16 | ControlFlowNode for attr_ref |
Original file line number Diff line number Diff line change @@ -60,10 +60,10 @@ def test_import():
6060def to_inner_scope ():
6161 x = tracked # $tracked
6262 def foo ():
63- y = x # $ MISSING: tracked
64- return y # $ MISSING: tracked
65- also_x = foo () # $ MISSING: tracked
66- print (also_x ) # $ MISSING: tracked
63+ y = x # $ tracked
64+ return y # $ tracked
65+ also_x = foo () # $ tracked
66+ print (also_x ) # $ tracked
6767
6868# ------------------------------------------------------------------------------
6969# Function decorator
Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ class TrackedTest extends InlineExpectationsTest {
2424 tracked ( t ) .flowsTo ( e ) and
2525 // Module variables have no sensible location, and hence can't be annotated.
2626 not e instanceof DataFlow:: ModuleVariableNode and
27+ // Global variables on line 0 also cannot be annotated
28+ not e .getLocation ( ) .getStartLine ( ) = 0 and
29+ // We do not wish to annotate scope entry definitions,
30+ // as they do not appear in the source code.
31+ not e .asVar ( ) instanceof ScopeEntryDefinition and
2732 tag = "tracked" and
2833 location = e .getLocation ( ) and
2934 value = t .getAttr ( ) and
You can’t perform that action at this time.
0 commit comments