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():
219
219
d = {'k' : SOURCE }
220
220
v = d .pop ("k" )
221
221
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"
224
226
225
227
@expects (2 )
226
228
def test_dict_get ():
227
229
d = {'k' : SOURCE }
228
230
v = d .get ("k" )
229
231
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"
232
234
233
235
@expects (2 )
234
236
def test_dict_popitem ():
@@ -321,6 +323,13 @@ def test_iter_dict():
321
323
l = list (i )
322
324
SINK (l [0 ]) #$ MISSING: flow="SOURCE, l:-3 -> l[0]"
323
325
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
+
324
333
### next
325
334
326
335
def test_next_list ():
You can’t perform that action at this time.
0 commit comments