Skip to content

Commit 862942f

Browse files
committed
python: extra test
suggested by @RasmusWL
1 parent adc82b5 commit 862942f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

python/ql/test/library-tests/dataflow/model-summaries/model_summaries.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,24 @@ class C(MS_Class_transitive):
140140
subclass_via_kw = C(x = SOURCE)
141141
SINK(subclass_via_kw.config) # $ flow="SOURCE, l:-1 -> subclass_via_kw.config"
142142

143+
class D(MS_Class_transitive):
144+
def __init__(x, y):
145+
# special handling of y
146+
super().__init__(x)
147+
148+
SINK(D(SOURCE, NONSOURCE).config) # $ flow="SOURCE -> D(..).config"
149+
SINK(D(x = SOURCE, y = NONSOURCE).config) # $ flow="SOURCE -> D(..).config"
150+
151+
class E(MS_Class_transitive):
152+
# Notice the swapped order of the arguments
153+
def __init__(y, x):
154+
# special handling of y
155+
super().__init__(x)
156+
157+
SINK(E(NONSOURCE, SOURCE).config) # $ MISSING: flow="SOURCE -> E(..).config"
158+
SINK(E(x = SOURCE, y = NONSOURCE).config) # $ flow="SOURCE -> E(..).config"
159+
160+
143161
# Modeled flow-summary is not value preserving
144162
from json import MS_loads as json_loads
145163

0 commit comments

Comments
 (0)