Skip to content

Commit a4af05d

Browse files
committed
Rust: fix extractor-tests
1 parent 8220aca commit a4af05d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import rust
2+
import TestUtils
23

3-
query predicate charLiteral(CharLiteralExpr e) { any() }
4+
query predicate charLiteral(CharLiteralExpr e) { toBeTested(e) }
45

5-
query predicate stringLiteral(StringLiteralExpr e) { any() }
6+
query predicate stringLiteral(StringLiteralExpr e) { toBeTested(e) }
67

78
query predicate integerLiteral(IntegerLiteralExpr e, string suffix) {
8-
suffix = concat(e.getSuffix())
9+
toBeTested(e) and suffix = concat(e.getSuffix())
910
}
1011

11-
query predicate floatLiteral(FloatLiteralExpr e, string suffix) { suffix = concat(e.getSuffix()) }
12+
query predicate floatLiteral(FloatLiteralExpr e, string suffix) {
13+
toBeTested(e) and suffix = concat(e.getSuffix())
14+
}
1215

13-
query predicate booleanLiteral(BooleanLiteralExpr e) { any() }
16+
query predicate booleanLiteral(BooleanLiteralExpr e) { toBeTested(e) }

rust/ql/test/extractor-tests/macro_expansion/PrintAst.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ macro_expansion.rs:
110110
# 2| getPath(): [Path] foo
111111
# 2| getSegment(): [PathSegment] foo
112112
# 2| getIdentifier(): [NameRef] foo
113-
# 1| getTailExpr(): [LiteralExpr] 0
113+
# 1| getTailExpr(): [IntegerLiteralExpr] 0
114114
# 1| getName(): [Name] foo___rust_ctor___ctor
115115
# 1| getRetType(): [RetTypeRepr] RetTypeRepr
116116
# 1| getTypeRepr(): [PathTypeRepr] usize

0 commit comments

Comments
 (0)