Merge pull request #7583 from michaelnebel/csharp/fix-broken-test

C#: Narrow string interpolation expressions to a specific single file in testcase.
This commit is contained in:
Michael Nebel
2022-01-13 11:37:52 +01:00
committed by GitHub

View File

@@ -1,7 +1,13 @@
import csharp
query predicate inserts(InterpolatedStringExpr expr, Expr e) { expr.getAnInsert() = e }
private predicate inSpecificSource(Expr expr) {
expr.getFile().getBaseName() = "ConstInterpolatedString.cs"
}
query predicate inserts(InterpolatedStringExpr expr, Expr e) {
expr.getAnInsert() = e and inSpecificSource(expr)
}
query predicate texts(InterpolatedStringExpr expr, StringLiteral literal) {
expr.getAText() = literal
expr.getAText() = literal and inSpecificSource(expr)
}