mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
Python: Add copy of extractor tests
These get to live next to the existing library and query tests, and are run as part of both the Python 2 and Python 3 language tests.
This commit is contained in:
2
python/ql/test/extractor-tests/splitter/Test.expected
Normal file
2
python/ql/test/extractor-tests/splitter/Test.expected
Normal file
@@ -0,0 +1,2 @@
|
||||
| is_int | is_int.py |
|
||||
| unreachable_split | unreachable_split.py |
|
||||
4
python/ql/test/extractor-tests/splitter/Test.ql
Normal file
4
python/ql/test/extractor-tests/splitter/Test.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import python
|
||||
|
||||
from Module m
|
||||
select m.getName(), m.getFile().getAbsolutePath()
|
||||
8
python/ql/test/extractor-tests/splitter/is_int.py
Normal file
8
python/ql/test/extractor-tests/splitter/is_int.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
# Handle `is`
|
||||
|
||||
def g(c):
|
||||
if c is 3:
|
||||
pass
|
||||
if c is not 4:
|
||||
pass
|
||||
13
python/ql/test/extractor-tests/splitter/unreachable_split.py
Normal file
13
python/ql/test/extractor-tests/splitter/unreachable_split.py
Normal file
@@ -0,0 +1,13 @@
|
||||
#Don't crash looking dominators of post-return part of the expression.
|
||||
|
||||
def f(c):
|
||||
return
|
||||
if c:
|
||||
x
|
||||
else:
|
||||
y
|
||||
if c:
|
||||
a
|
||||
else:
|
||||
b
|
||||
|
||||
Reference in New Issue
Block a user