diff --git a/python/ql/test/experimental/dataflow/fieldflow/test_dict.py b/python/ql/test/experimental/dataflow/fieldflow/test_dict.py index c2f74b83c3d..2a55885e2b9 100644 --- a/python/ql/test/experimental/dataflow/fieldflow/test_dict.py +++ b/python/ql/test/experimental/dataflow/fieldflow/test_dict.py @@ -45,6 +45,16 @@ def test_dict_update(): SINK(d["key"]) # $ flow="SOURCE, l:-1 -> d['key']" SINK(d.get("key")) # $ flow="SOURCE, l:-2 -> d.get(..)" + +@expects(2) # $ unresolved_call=expects(..) unresolved_call=expects(..)(..) +def test_dict_update_fresh_key(): + # we had a regression where we did not create a dictionary element content + # for keys used in "inline update" like this + d = {} + d["fresh_key"] = SOURCE + SINK(d["fresh_key"]) # $ MISSING: flow="SOURCE, l:-1 -> d['fresh_key']" + + @expects(3) # $ unresolved_call=expects(..) unresolved_call=expects(..)(..) def test_dict_setdefault(): d = {}