Skip to content

Commit f2b45b8

Browse files
committed
C#: Add type locations test.
1 parent 1f2cca7 commit f2b45b8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

csharp/ql/test/library-tests/locations/locations.expected

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,11 @@ accessor_location
5050
| B.cs:3:14:3:14 | B | B.cs:10:9:10:11 | set_Item | B.cs:10:9:10:11 | B.cs:10:9:10:11 |
5151
| B.cs:3:14:3:14 | B | B.cs:15:9:15:11 | add_Event | B.cs:15:9:15:11 | B.cs:15:9:15:11 |
5252
| B.cs:3:14:3:14 | B | B.cs:16:9:16:14 | remove_Event | B.cs:16:9:16:14 | B.cs:16:9:16:14 |
53+
type_location
54+
| A.cs:3:23:3:26 | A<Int32> | A.cs:3:23:3:26 | A.cs:3:23:3:26 |
55+
| A.cs:3:23:3:26 | A<String> | A.cs:3:23:3:26 | A.cs:3:23:3:26 |
56+
| A.cs:3:23:3:26 | A`1 | A.cs:3:23:3:26 | A.cs:3:23:3:26 |
57+
| A.cs:3:25:3:25 | T | A.cs:3:25:3:25 | A.cs:3:25:3:25 |
58+
| A.cs:12:14:12:15 | A2 | A.cs:12:14:12:15 | A.cs:12:14:12:15 |
59+
| B.cs:3:14:3:14 | B | B.cs:3:14:3:14 | B.cs:3:14:3:14 |
60+
| C.cs:3:7:3:7 | C | C.cs:3:7:3:7 | C.cs:3:7:3:7 |

csharp/ql/test/library-tests/locations/locations.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ query predicate accessor_location(Type t, Accessor a, SourceLocation l) {
1212
l = a.getLocation() and
1313
not l instanceof EmptyLocation
1414
}
15+
16+
query predicate type_location(Type t, SourceLocation l) {
17+
l = t.getLocation() and not l instanceof EmptyLocation
18+
}

0 commit comments

Comments
 (0)