Skip to content

Commit 456c659

Browse files
committed
f test no location %_src% check
1 parent 9229b77 commit 456c659

File tree

1 file changed

+17
-52
lines changed
  • python/ql/test/extractor-tests/overlay/basic-full-eval

1 file changed

+17
-52
lines changed
Lines changed: 17 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,19 @@
11
import python
22

3-
query predicate testStringLiterals(StringLiteral l, string text) {
4-
l.getText() = text and
5-
(
6-
not exists(l.getLocation())
7-
or
8-
l.getLocation().toString().matches("%_src%")
9-
)
10-
}
11-
12-
query predicate testModules(Module m) {
13-
not exists(m.getLocation())
14-
or
15-
m.getLocation().toString().matches("%_src%")
16-
}
17-
18-
query predicate testFunctions(Function f) {
19-
not exists(f.getLocation())
20-
or
21-
f.getLocation().toString().matches("%_src%")
22-
}
23-
24-
query predicate testClasses(Class c) {
25-
not exists(c.getLocation())
26-
or
27-
c.getLocation().toString().matches("%_src%")
28-
}
29-
30-
query predicate testLocations(Location l) { l.toString().matches("%_src%") }
31-
32-
query predicate testFiles(File f) { f.toString().matches("%_src%") }
33-
34-
query predicate testCfgNodes(ControlFlowNode n) {
35-
not exists(n.getLocation())
36-
or
37-
n.getLocation().toString().matches("%_src%")
38-
}
39-
40-
query predicate testSsaVars(SsaVariable var) {
41-
not exists(var.getLocation()) and
42-
var.getVariable().getScope().getLocation().toString().matches("%_src%")
43-
or
44-
var.getLocation().toString().matches("%_src%")
45-
}
46-
47-
query predicate testVars(Variable var, Scope s) {
48-
s = var.getScope() and
49-
(
50-
not exists(s.getLocation())
51-
or
52-
s.getLocation().toString().matches("%_src%")
53-
)
54-
}
3+
query predicate testStringLiterals(StringLiteral l, string text) { l.getText() = text }
4+
5+
query predicate testModules(Module m) { any() }
6+
7+
query predicate testFunctions(Function f) { any() }
8+
9+
query predicate testClasses(Class c) { any() }
10+
11+
query predicate testLocations(Location l) { any() }
12+
13+
query predicate testFiles(File f) { any() }
14+
15+
query predicate testCfgNodes(ControlFlowNode n) { any() }
16+
17+
query predicate testSsaVars(SsaVariable var) { any() }
18+
19+
query predicate testVars(Variable var, Scope s) { s = var.getScope() }

0 commit comments

Comments
 (0)