C#: Add test using the new escape char for ESCAPE.

This commit is contained in:
Michael Nebel
2025-01-02 11:57:42 +01:00
parent 68ca307ac9
commit 75e562d0f0
3 changed files with 21 additions and 0 deletions

View File

@@ -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";
}
}

View File

@@ -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 |

View File

@@ -0,0 +1,5 @@
import csharp
query predicate stringLiterals(StringLiteral lit, string value) {
lit.fromSource() and value = lit.getValue()
}