Skip to content

Commit c86e008

Browse files
committed
JavaInlineExpectations: remove actualLines()
1 parent 7370a2e commit c86e008

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

java/ql/test/TestUtilities/JavaInlineExpectations.ql

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ import java
66

77
external predicate queryResults(string relation, int row, int column, string data);
88

9-
string actualLines() {
10-
exists(int i |
11-
queryResults("#select", i, _, _) and
12-
result =
13-
" | " +
14-
concat(int j, string cell | queryResults("#select", i, j, cell) | cell, " | " order by j) +
15-
" | "
16-
)
17-
}
18-
199
predicate parsedExpectedResults(string filename, int line, string content) {
2010
exists(Javadoc doc |
2111
isEolComment(doc) and
@@ -39,17 +29,16 @@ predicate expectPass(string filename, int line) {
3929
}
4030

4131
predicate parsedActualResults(string filename, int line, int colStart, int colEnd, string content) {
42-
exists(string s, string posString, string lineString |
43-
s = actualLines() and
44-
posString = s.substring(s.indexOf("|", 0, 0) + 1, s.indexOf("|", 1, 0)).trim() and
32+
exists(int i, string posString, string lineString |
33+
queryResults("#select", i, 0, posString) and
4534
filename = posString.substring(0, posString.indexOf(":", 0, 0)) and
4635
lineString = posString.substring(posString.indexOf(":", 0, 0) + 1, posString.indexOf(":", 1, 0)) and
4736
lineString = posString.substring(posString.indexOf(":", 2, 0) + 1, posString.indexOf(":", 3, 0)) and
4837
colStart =
4938
posString.substring(posString.indexOf(":", 1, 0) + 1, posString.indexOf(":", 2, 0)).toInt() and
5039
colEnd = posString.substring(posString.indexOf(":", 3, 0) + 1, posString.length()).toInt() and
5140
line = lineString.toInt() and
52-
content = s.substring(s.indexOf("|", 2, 0) + 1, s.indexOf("|", 3, 0)).trim()
41+
queryResults("#select", i, 2, content)
5342
)
5443
}
5544

0 commit comments

Comments
 (0)