mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Python: Add 2-only library tests.
This commit is contained in:
16
python/ql/test/2/library-tests/objects/Literals.ql
Normal file
16
python/ql/test/2/library-tests/objects/Literals.ql
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
/* Test that there are no literals that do not have a corresponding object. */
|
||||
import python
|
||||
|
||||
|
||||
string repr(Expr e) {
|
||||
result = e.(Num).getN() or
|
||||
result = e.(Bytes).getS() or
|
||||
result = e.(Unicode).getS()
|
||||
}
|
||||
|
||||
from ImmutableLiteral l
|
||||
where
|
||||
not exists(l.getLiteralObject())
|
||||
|
||||
select l.getLocation().getStartLine(), repr(l)
|
||||
5
python/ql/test/2/library-tests/objects/test.py
Normal file
5
python/ql/test/2/library-tests/objects/test.py
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
0666
|
||||
01
|
||||
1L
|
||||
4987312561856745907287624786230562734672583763984576267L
|
||||
Reference in New Issue
Block a user