Skip to content

Commit e8e1dc0

Browse files
committed
C#: Add integration test with extraction and compilation messages
1 parent daee22d commit e8e1dc0

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| Program.cs:2:9:2:9 | CS0103: The name 'M' does not exist in the current context | Error CS0103 The name 'M' does not exist in the current context |
2+
| Program.cs:2:15:2:15 | CS0103: The name 'M' does not exist in the current context | Error CS0103 The name 'M' does not exist in the current context |
3+
| Program.cs:2:21:2:21 | CS0103: The name 'M' does not exist in the current context | Error CS0103 The name 'M' does not exist in the current context |
4+
| test-db/working/implicitUsings/GlobalUsings.g.cs:3:1:3:28 | CS8019: Unnecessary using directive. | Hidden CS8019 Unnecessary using directive. |
5+
| test-db/working/implicitUsings/GlobalUsings.g.cs:4:1:4:48 | CS8019: Unnecessary using directive. | Hidden CS8019 Unnecessary using directive. |
6+
| test-db/working/implicitUsings/GlobalUsings.g.cs:5:1:5:31 | CS8019: Unnecessary using directive. | Hidden CS8019 Unnecessary using directive. |
7+
| test-db/working/implicitUsings/GlobalUsings.g.cs:6:1:6:33 | CS8019: Unnecessary using directive. | Hidden CS8019 Unnecessary using directive. |
8+
| test-db/working/implicitUsings/GlobalUsings.g.cs:7:1:7:37 | CS8019: Unnecessary using directive. | Hidden CS8019 Unnecessary using directive. |
9+
| test-db/working/implicitUsings/GlobalUsings.g.cs:8:1:8:38 | CS8019: Unnecessary using directive. | Hidden CS8019 Unnecessary using directive. |
10+
| test-db/working/implicitUsings/GlobalUsings.g.cs:9:1:9:44 | CS8019: Unnecessary using directive. | Hidden CS8019 Unnecessary using directive. |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import csharp
2+
import semmle.code.csharp.commons.Diagnostics
3+
4+
from Diagnostic diagnostic
5+
select diagnostic,
6+
diagnostic.getSeverityText() + " " + diagnostic.getTag() + " " + diagnostic.getFullMessage()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
| Program.cs:2:9:2:11 | Failed to determine type | 5 | M() |
2+
| Program.cs:2:9:2:11 | Unable to resolve target for call. (Compilation error?) | 5 | M() |
3+
| Program.cs:2:9:2:17 | Failed to determine type | 5 | M() + M() |
4+
| Program.cs:2:9:2:23 | Failed to determine type | 5 | M() + M() + M() |
5+
| Program.cs:2:15:2:17 | Failed to determine type | 5 | M() |
6+
| Program.cs:2:15:2:17 | Unable to resolve target for call. (Compilation error?) | 5 | M() |
7+
| Program.cs:2:21:2:23 | Failed to determine type | 5 | M() |
8+
| Program.cs:2:21:2:23 | Unable to resolve target for call. (Compilation error?) | 5 | M() |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import csharp
2+
import semmle.code.csharp.commons.Diagnostics
3+
4+
query predicate extractorMessages(ExtractorMessage msg, int severity, string elementText) {
5+
msg.getSeverity() = severity and msg.getElementText() = elementText
6+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
var dummy = "dummy";
1+
var dummy = "dummy";
2+
dummy = M() + M() + M();

0 commit comments

Comments
 (0)