mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
C#: Add lambda attributes test cases.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
allAttributes
|
||||
| LambdaAttributes.cs:14:20:14:26 | [Example(...)] | LambdaAttributes.cs:14:28:14:28 | 1 | Parameter |
|
||||
| LambdaAttributes.cs:15:18:15:24 | [Example(...)] | LambdaAttributes.cs:15:26:15:26 | 2 | LambdaExpr |
|
||||
| LambdaAttributes.cs:16:26:16:32 | [return: Example(...)] | LambdaAttributes.cs:16:34:16:34 | 3 | LambdaExpr |
|
||||
lambdaAttributes
|
||||
| LambdaAttributes.cs:15:18:15:24 | [Example(...)] | LambdaAttributes.cs:15:26:15:26 | 2 | LambdaAttributes.cs:15:17:15:52 | (...) => ... |
|
||||
| LambdaAttributes.cs:16:26:16:32 | [return: Example(...)] | LambdaAttributes.cs:16:34:16:34 | 3 | LambdaAttributes.cs:16:17:16:60 | (...) => ... |
|
||||
11
csharp/ql/test/library-tests/csharp10/lambdaAttributes.ql
Normal file
11
csharp/ql/test/library-tests/csharp10/lambdaAttributes.ql
Normal file
@@ -0,0 +1,11 @@
|
||||
import csharp
|
||||
|
||||
query predicate allAttributes(Attribute a, Expr arg, string c) {
|
||||
a.fromSource() and
|
||||
arg = a.getArgument(0) and
|
||||
c = a.getTarget().(Element).getAPrimaryQlClass()
|
||||
}
|
||||
|
||||
query predicate lambdaAttributes(Attribute a, Expr arg, LambdaExpr l) {
|
||||
allAttributes(a, arg, _) and a.getTarget() = l
|
||||
}
|
||||
Reference in New Issue
Block a user