File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
python/ql/test/experimental/dataflow/coverage Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -219,16 +219,18 @@ def test_dict_pop():
219219 d = {'k' : SOURCE }
220220 v = d .pop ("k" )
221221 SINK (v ) #$ flow="SOURCE, l:-2 -> v"
222- v1 = d .pop ("k" , SOURCE )
223- SINK (v1 ) #$ flow="SOURCE, l:-4 -> v1"
222+ v1 = d .pop ("k" , NONSOURCE )
223+ SINK_F (v1 ) #$ SPURIOUS: flow="SOURCE, l:-4 -> v1"
224+ v2 = d .pop ("non-existing" , SOURCE )
225+ SINK (v2 ) #$ MISSING: flow="SOURCE, l:-1 -> v2"
224226
225227@expects (2 )
226228def test_dict_get ():
227229 d = {'k' : SOURCE }
228230 v = d .get ("k" )
229231 SINK (v ) #$ flow="SOURCE, l:-2 -> v"
230- v1 = d .get ("k " , SOURCE )
231- SINK (v1 ) #$ flow="SOURCE, l:-4 -> v1"
232+ v1 = d .get ("non-existing " , SOURCE )
233+ SINK (v1 ) #$ flow="SOURCE, l:-1 -> v1"
232234
233235@expects (2 )
234236def test_dict_popitem ():
@@ -321,6 +323,13 @@ def test_iter_dict():
321323 l = list (i )
322324 SINK (l [0 ]) #$ MISSING: flow="SOURCE, l:-3 -> l[0]"
323325
326+ def test_iter_iter ():
327+ # applying iter() to the result of iter() is basically a no-op
328+ l0 = [SOURCE ]
329+ i = iter (iter (l0 ))
330+ l = list (i )
331+ SINK (l [0 ]) #$ MISSING: flow="SOURCE, l:-3 -> l[0]"
332+
324333### next
325334
326335def test_next_list ():
You can’t perform that action at this time.
0 commit comments