mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C#: Add tests and update expected test output.
This commit is contained in:
@@ -106,8 +106,8 @@ arguments
|
||||
| attributes.cs:151:6:151:11 | [Params(...)] | 0 | attributes.cs:151:45:151:47 | "a" |
|
||||
| attributes.cs:151:6:151:11 | [Params(...)] | 1 | attributes.cs:151:36:151:38 | "b" |
|
||||
| attributes.cs:151:6:151:11 | [Params(...)] | 2 | attributes.cs:151:19:151:29 | array creation of type Int32[] |
|
||||
| attributes.cs:155:2:155:13 | [Experimental(...)] | 0 | attributes.cs:155:15:155:35 | "MyExperimentalClass" |
|
||||
| attributes.cs:158:6:158:17 | [Experimental(...)] | 0 | attributes.cs:158:19:158:40 | "MyExperimentalMethod" |
|
||||
| attributes.cs:155:2:155:13 | [Experimental(...)] | 0 | attributes.cs:155:15:155:37 | "MyExperimentalClassId" |
|
||||
| attributes.cs:158:6:158:17 | [Experimental(...)] | 0 | attributes.cs:158:19:158:42 | "MyExperimentalMethodId" |
|
||||
constructorArguments
|
||||
| Assembly1.dll:0:0:0:0 | [Custom(...)] | 0 | Assembly1.dll:0:0:0:0 | 1 |
|
||||
| Assembly1.dll:0:0:0:0 | [Custom(...)] | 0 | Assembly1.dll:0:0:0:0 | 3 |
|
||||
@@ -204,8 +204,8 @@ constructorArguments
|
||||
| attributes.cs:151:6:151:11 | [Params(...)] | 0 | attributes.cs:151:45:151:47 | "a" |
|
||||
| attributes.cs:151:6:151:11 | [Params(...)] | 1 | attributes.cs:151:36:151:38 | "b" |
|
||||
| attributes.cs:151:6:151:11 | [Params(...)] | 2 | attributes.cs:151:19:151:29 | array creation of type Int32[] |
|
||||
| attributes.cs:155:2:155:13 | [Experimental(...)] | 0 | attributes.cs:155:15:155:35 | "MyExperimentalClass" |
|
||||
| attributes.cs:158:6:158:17 | [Experimental(...)] | 0 | attributes.cs:158:19:158:40 | "MyExperimentalMethod" |
|
||||
| attributes.cs:155:2:155:13 | [Experimental(...)] | 0 | attributes.cs:155:15:155:37 | "MyExperimentalClassId" |
|
||||
| attributes.cs:158:6:158:17 | [Experimental(...)] | 0 | attributes.cs:158:19:158:42 | "MyExperimentalMethodId" |
|
||||
namedArguments
|
||||
| Assembly1.dll:0:0:0:0 | [Custom(...)] | Prop2 | Assembly1.dll:0:0:0:0 | array creation of type Object[] |
|
||||
| Assembly1.dll:0:0:0:0 | [Custom(...)] | Prop2 | Assembly1.dll:0:0:0:0 | array creation of type Object[] |
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
| attributes.cs:156:14:156:32 | MyExperimentalClass | attributes.cs:155:2:155:13 | [Experimental(...)] | MyExperimentalClassId |
|
||||
| attributes.cs:159:17:159:36 | MyExperimentalMethod | attributes.cs:158:6:158:17 | [Experimental(...)] | MyExperimentalMethodId |
|
||||
@@ -0,0 +1,6 @@
|
||||
import csharp
|
||||
import semmle.code.csharp.frameworks.system.diagnostics.CodeAnalysis
|
||||
|
||||
from Attributable element, ExperimentalAttribute attribute
|
||||
where attribute = element.getAnAttribute() and attribute.fromSource()
|
||||
select element, attribute, attribute.getId()
|
||||
@@ -465,11 +465,11 @@ attributes.cs:
|
||||
#-----| 0: (Attributes)
|
||||
# 155| 1: [DefaultAttribute] [Experimental(...)]
|
||||
# 155| -1: [TypeMention] ExperimentalAttribute
|
||||
# 155| 0: [StringLiteralUtf16] "MyExperimentalClass"
|
||||
# 155| 0: [StringLiteralUtf16] "MyExperimentalClassId"
|
||||
# 159| 5: [Method] MyExperimentalMethod
|
||||
# 159| -1: [TypeMention] Void
|
||||
#-----| 0: (Attributes)
|
||||
# 158| 1: [DefaultAttribute] [Experimental(...)]
|
||||
# 158| -1: [TypeMention] ExperimentalAttribute
|
||||
# 158| 0: [StringLiteralUtf16] "MyExperimentalMethod"
|
||||
# 158| 0: [StringLiteralUtf16] "MyExperimentalMethodId"
|
||||
# 159| 4: [BlockStmt] {...}
|
||||
|
||||
@@ -152,9 +152,9 @@ class Class1
|
||||
public void M4() { }
|
||||
}
|
||||
|
||||
[Experimental("MyExperimentalClass")]
|
||||
[Experimental("MyExperimentalClassId")]
|
||||
public class MyExperimentalClass
|
||||
{
|
||||
[Experimental("MyExperimentalMethod")]
|
||||
[Experimental("MyExperimentalMethodId")]
|
||||
public void MyExperimentalMethod() { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user