Skip to content

Commit 6ee3084

Browse files
committed
C#: Add lambda attributes test cases.
1 parent 7b3ba3c commit 6ee3084

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
allAttributes
2+
| LambdaAttributes.cs:14:20:14:26 | [Example(...)] | LambdaAttributes.cs:14:28:14:28 | 1 | Parameter |
3+
| LambdaAttributes.cs:15:18:15:24 | [Example(...)] | LambdaAttributes.cs:15:26:15:26 | 2 | LambdaExpr |
4+
| LambdaAttributes.cs:16:26:16:32 | [return: Example(...)] | LambdaAttributes.cs:16:34:16:34 | 3 | LambdaExpr |
5+
lambdaAttributes
6+
| LambdaAttributes.cs:15:18:15:24 | [Example(...)] | LambdaAttributes.cs:15:26:15:26 | 2 | LambdaAttributes.cs:15:17:15:52 | (...) => ... |
7+
| LambdaAttributes.cs:16:26:16:32 | [return: Example(...)] | LambdaAttributes.cs:16:34:16:34 | 3 | LambdaAttributes.cs:16:17:16:60 | (...) => ... |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import csharp
2+
3+
query predicate allAttributes(Attribute a, Expr arg, string c) {
4+
a.fromSource() and
5+
arg = a.getArgument(0) and
6+
c = a.getTarget().(Element).getAPrimaryQlClass()
7+
}
8+
9+
query predicate lambdaAttributes(Attribute a, Expr arg, LambdaExpr l) {
10+
allAttributes(a, arg, _) and a.getTarget() = l
11+
}

0 commit comments

Comments
 (0)