Python: Limit test files

This commit is contained in:
Rasmus Lerchedahl Petersen
2021-06-29 11:18:24 +02:00
parent 6f2cdbf59e
commit fbfe415162
4 changed files with 10 additions and 3 deletions

View File

@@ -2,6 +2,8 @@ import python
import semmle.python.regex
from Regex r, int start, int end, int part_start, int part_end
where r.alternationOption(start, end, part_start, part_end)
where
r.getLocation().getFile().getBaseName() = "test.py" and
r.alternationOption(start, end, part_start, part_end)
select r.getText(), start, end, r.getText().substring(start, end), part_start, part_end,
r.getText().substring(part_start, part_end)

View File

@@ -2,6 +2,8 @@ import python
import semmle.python.regex
from Regex r, int start, int end, int part_start, int part_end
where r.groupContents(start, end, part_start, part_end)
where
r.getLocation().getFile().getBaseName() = "test.py" and
r.groupContents(start, end, part_start, part_end)
select r.getText(), start, end, r.getText().substring(start, end), part_start, part_end,
r.getText().substring(part_start, part_end)

View File

@@ -2,4 +2,5 @@ import python
import semmle.python.regex
from Regex r
where r.getLocation().getFile().getBaseName() = "test.py"
select r.getLocation().getStartLine(), r.getAMode()

View File

@@ -2,5 +2,7 @@ import python
import semmle.python.regex
from Regex r, int start, int end, boolean maybe_empty, boolean may_repeat_forever
where r.qualifiedItem(start, end, maybe_empty, may_repeat_forever)
where
r.getLocation().getFile().getBaseName() = "test.py" and
r.qualifiedItem(start, end, maybe_empty, may_repeat_forever)
select r.getText(), start, end, maybe_empty, may_repeat_forever