File tree Expand file tree Collapse file tree 4 files changed +29
-26
lines changed
python/ql/test/library-tests/dataflow Expand file tree Collapse file tree 4 files changed +29
-26
lines changed Original file line number Diff line number Diff line change 1+ missingAnnotationOnSink
2+ testFailures
Original file line number Diff line number Diff line change 1+ import python
2+ import utils.test.dataflow.NormalDataflowTest
Original file line number Diff line number Diff line change 1+ # PEP 798: Unpacking in comprehensions.
2+ # These desugar to `yield from`, so flow depends on yield-from support.
3+
4+ def test_star_list_comp ():
5+ l = [[SOURCE ]]
6+ flat = [* x for x in l ]
7+ SINK (flat [0 ]) # $ MISSING:flow="SOURCE, l:-2 -> flat[0]"
8+
9+
10+ def test_star_set_comp ():
11+ l = [[SOURCE ]]
12+ flat = {* x for x in l }
13+ SINK (flat .pop ()) # $ MISSING:flow="SOURCE, l:-2 -> flat.pop()"
14+
15+
16+ def test_star_genexp ():
17+ l = [[SOURCE ]]
18+ g = (* x for x in l )
19+ SINK (next (g )) # $ MISSING:flow="SOURCE, l:-2 -> next()"
20+
21+
22+ def test_star_dictcomp ():
23+ l = [{"key" : SOURCE }]
24+ merged = {** d for d in l }
25+ SINK (merged ["key" ]) # $ MISSING:flow="SOURCE, l:-2 -> merged[..]"
Original file line number Diff line number Diff line change @@ -257,32 +257,6 @@ def test_yield_from():
257257 SINK (next (g )) # $ MISSING:flow="SOURCE, l:-1 -> next()"
258258
259259
260- # PEP 798: Unpacking in comprehensions.
261- # These desugar to `yield from`, so flow depends on yield-from support (see above).
262- def test_star_list_comp ():
263- l = [[SOURCE ]]
264- flat = [* x for x in l ]
265- SINK (flat [0 ]) # $ MISSING:flow="SOURCE, l:-2 -> flat[0]"
266-
267-
268- def test_star_set_comp ():
269- l = [[SOURCE ]]
270- flat = {* x for x in l }
271- SINK (flat .pop ()) # $ MISSING:flow="SOURCE, l:-2 -> flat.pop()"
272-
273-
274- def test_star_genexp ():
275- l = [[SOURCE ]]
276- g = (* x for x in l )
277- SINK (next (g )) # $ MISSING:flow="SOURCE, l:-2 -> next()"
278-
279-
280- def test_star_dictcomp ():
281- l = [{"key" : SOURCE }]
282- merged = {** d for d in l }
283- SINK (merged ["key" ]) # $ MISSING:flow="SOURCE, l:-2 -> merged[..]"
284-
285-
286260# a statement rather than an expression, but related to generators
287261def test_for ():
288262 for x in gen (SOURCE ):
You can’t perform that action at this time.
0 commit comments