mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
C#: Update string literal test query and expected output.
This commit is contained in:
@@ -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 |
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user