Skip to content

Commit

Permalink
Merge pull request #18384 from michaelnebel/csharp13/escapechars
Browse files Browse the repository at this point in the history
C# 13: [TEST ONLY] Add test using the new escape char for ESCAPE.
  • Loading branch information
michaelnebel authored Jan 3, 2025
2 parents 49abfdf + 75e562d commit 7a7d8e4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions csharp/ql/test/library-tests/strings/Strings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

public class TestClass
{
public void M()
{
var x1 = "Hello world";
var x2 = "\u001b";
var x3 = "\x1b";
var x4 = "\e";
}
}
4 changes: 4 additions & 0 deletions csharp/ql/test/library-tests/strings/stringLiterals.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
| Strings.cs:7:18:7:30 | "Hello world" | Hello world |
| Strings.cs:8:18:8:25 | "\u001b" | \u001b |
| Strings.cs:9:18:9:23 | "\u001b" | \u001b |
| Strings.cs:10:18:10:21 | "\u001b" | \u001b |
5 changes: 5 additions & 0 deletions csharp/ql/test/library-tests/strings/stringLiterals.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import csharp

query predicate stringLiterals(StringLiteral lit, string value) {
lit.fromSource() and value = lit.getValue()
}

0 comments on commit 7a7d8e4

Please sign in to comment.