Skip to content

Commit 5249b54

Browse files
committed
Python: Highlight missing flow from default value in functions
Although it is becoming non-trivial to get an overview of what tests we have and don't have, I didn't find any that highlighted this one I used all 3 variants of parameters, just to be sure :)
1 parent c4cca83 commit 5249b54

File tree

1 file changed

+6
-0
lines changed
  • python/ql/test/experimental/dataflow/coverage

1 file changed

+6
-0
lines changed

python/ql/test/experimental/dataflow/coverage/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,3 +781,9 @@ def test_reverse_read_subscript_cls():
781781
l = [withA]
782782
l[0].setA(SOURCE)
783783
SINK(withA.a) #$ MISSING:flow="SOURCE, l:-1 -> self.a"
784+
785+
@expects(3)
786+
def test_with_default_param_value(x=SOURCE, /, y=SOURCE, *, z=SOURCE):
787+
SINK(x) #$ MISSING:flow="SOURCE, l:-1 -> x"
788+
SINK(y) #$ MISSING:flow="SOURCE, l:-2 -> y"
789+
SINK(z) #$ MISSING:flow="SOURCE, l:-3 -> z"

0 commit comments

Comments
 (0)