mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C#: Add test using the new escape char for ESCAPE.
This commit is contained in:
12
csharp/ql/test/library-tests/strings/Strings.cs
Normal file
12
csharp/ql/test/library-tests/strings/Strings.cs
Normal 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";
|
||||
}
|
||||
}
|
||||
@@ -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
csharp/ql/test/library-tests/strings/stringLiterals.ql
Normal file
5
csharp/ql/test/library-tests/strings/stringLiterals.ql
Normal file
@@ -0,0 +1,5 @@
|
||||
import csharp
|
||||
|
||||
query predicate stringLiterals(StringLiteral lit, string value) {
|
||||
lit.fromSource() and value = lit.getValue()
|
||||
}
|
||||
Reference in New Issue
Block a user