C#: Update string literal test query and expected output.

This commit is contained in:
Michael Nebel
2023-01-19 12:29:53 +01:00
parent 5c5d330704
commit 5a1e96d671
2 changed files with 13 additions and 8 deletions

View File

@@ -11,9 +11,11 @@ interpolatedstrings
| Strings.cs:33:24:36:11 | $"..." | Strings.cs:35:47:35:54 | access to local variable message2 |
| Strings.cs:33:24:36:11 | $"..." | Strings.cs:35:57:35:57 | "}" |
stringliterals
| Strings.cs:18:24:23:11 | "This is my very long\n text message that spans\n accross multiple lines\nand is very useful." |
| Strings.cs:27:1:28:14 | "The nested message\n is \\"" |
| Strings.cs:28:25:29:29 | "\\" and everything\nspans multiple lines." |
| Strings.cs:34:1:34:30 | "Show no curly braces: " |
| Strings.cs:34:43:35:44 | "\nShow matching set of curly braces: {" |
| Strings.cs:35:57:35:57 | "}" |
| Strings.cs:18:24:23:11 | "This is my very long\n text message that spans\n accross multiple lines\nand is very useful." | StringLiteralUtf16 | String |
| Strings.cs:27:1:28:14 | "The nested message\n is \\"" | StringLiteralUtf16 | String |
| Strings.cs:28:25:29:29 | "\\" and everything\nspans multiple lines." | StringLiteralUtf16 | String |
| Strings.cs:34:1:34:30 | "Show no curly braces: " | StringLiteralUtf16 | String |
| Strings.cs:34:43:35:44 | "\nShow matching set of curly braces: {" | StringLiteralUtf16 | String |
| Strings.cs:35:57:35:57 | "}" | StringLiteralUtf16 | String |
| Strings.cs:43:17:43:27 | "AUTH8: " | StringLiteralUtf8 | ReadOnlySpan<Byte> |
| Strings.cs:46:17:46:26 | "AUTH16: " | StringLiteralUtf16 | String |

View File

@@ -5,6 +5,9 @@ query predicate interpolatedstrings(InterpolatedStringExpr se, Expr e) {
(e = se.getAText() or e = se.getAnInsert())
}
query predicate stringliterals(StringLiteral s) {
s.getFile().getStem() = "Strings" and s.getEnclosingCallable().getName() = "M2"
query predicate stringliterals(StringLiteral s, string qlclass, string type) {
s.getFile().getStem() = "Strings" and
s.getEnclosingCallable().getName() = ["M2", "M3"] and
qlclass = s.getAPrimaryQlClass() and
type = s.getType().toString()
}