Skip to content

Commit 0df9aac

Browse files
authored
Merge pull request #21988 from owen-mc/ql/convert-qlref-tests-inline-expectations
QL: Convert qlref tests to inline expectations
2 parents 7039c4a + 78d9571 commit 0df9aac

57 files changed

Lines changed: 135 additions & 110 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ql/ql/test/queries/bugs/OrderByConst/Foo.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
string foo() {
2-
result = concat(string x | x = [0 .. 10].toString() | x order by x desc, ", ") // BAD
2+
result = concat(string x | x = [0 .. 10].toString() | x order by x desc, ", ") // $ Alert // BAD
33
or
44
result = concat(string x | x = [0 .. 10].toString() | x, ", " order by x desc) // GOOD
55
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
queries/bugs/OrderByConst.ql
1+
query: queries/bugs/OrderByConst.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
queries/bugs/SumWithoutDomain.ql
1+
query: queries/bugs/SumWithoutDomain.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

ql/ql/test/queries/bugs/SumWithoutDomain/Test.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Result is 3 and not 4
22
int foo() {
3-
result = sum([1, 1, 2]) // <- Alert here
3+
result = sum([1, 1, 2]) // $ Alert // <- Alert here
44
}
55

66
// Ok - false negative
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
queries/overlay/InlineOverlayCaller.ql
1+
query: queries/overlay/InlineOverlayCaller.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

ql/ql/test/queries/overlay/InlineOverlayCaller/Test.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module;
44
import ql
55

66
pragma[inline]
7-
predicate foo(int x) { x = 42 }
7+
predicate foo(int x) { x = 42 } // $ Alert
88

99
overlay[caller]
1010
pragma[inline]
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
queries/performance/AbstractClassImport.ql
1+
query: queries/performance/AbstractClassImport.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import ql
22
import AbstractClassImportTest2
33

4-
abstract class Base extends AstNode { }
4+
abstract class Base extends AstNode { } // $ Alert
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
queries/performance/MissingNoinline.ql
1+
query: queries/performance/MissingNoinline.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

ql/ql/test/queries/performance/MissingNoInline/Test.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ql
55
*
66
* This predicate exists to fix a join order.
77
*/
8-
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) {
8+
predicate missingNoInline(AddExpr add, Expr e1, Expr e2) { // $ Alert
99
// BAD
1010
add.getLeftOperand() = e1 and
1111
add.getRightOperand() = e2

0 commit comments

Comments
 (0)