Skip to content

Commit 8583a4f

Browse files
authored
Merge pull request #7583 from michaelnebel/csharp/fix-broken-test
C#: Narrow string interpolation expressions to a specific single file in testcase.
2 parents 89bab6a + aacb03a commit 8583a4f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import csharp
22

3-
query predicate inserts(InterpolatedStringExpr expr, Expr e) { expr.getAnInsert() = e }
3+
private predicate inSpecificSource(Expr expr) {
4+
expr.getFile().getBaseName() = "ConstInterpolatedString.cs"
5+
}
6+
7+
query predicate inserts(InterpolatedStringExpr expr, Expr e) {
8+
expr.getAnInsert() = e and inSpecificSource(expr)
9+
}
410

511
query predicate texts(InterpolatedStringExpr expr, StringLiteral literal) {
6-
expr.getAText() = literal
12+
expr.getAText() = literal and inSpecificSource(expr)
713
}

0 commit comments

Comments
 (0)