Skip to content

Commit beeadea

Browse files
committed
Add extra tests for partial methods
1 parent eba2c43 commit beeadea

File tree

7 files changed

+58
-15
lines changed

7 files changed

+58
-15
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| Partial.cs:3:18:3:39 | PartialMethodWithBody1 | true |
2+
| Partial.cs:4:18:4:42 | PartialMethodWithoutBody1 | true |
3+
| Partial.cs:5:17:5:23 | Method2 | false |
4+
| Partial.cs:11:17:11:23 | Method3 | false |
5+
| Partial.cs:16:18:16:42 | PartialMethodWithoutBody2 | true |
6+
| Partial.cs:17:17:17:23 | Method4 | false |
7+
| Partial.cs:22:17:22:23 | Method5 | false |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import csharp
2+
3+
private boolean isPartial(Method m) { if m.isPartial() then result = true else result = false }
4+
5+
from Method m
6+
where m.fromSource()
7+
select m, isPartial(m)
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
partial class A
1+
partial class TwoPartClass
22
{
3-
partial void M();
4-
public void M2() { }
3+
partial void PartialMethodWithBody1();
4+
partial void PartialMethodWithoutBody1();
5+
public void Method2() { }
56
}
67

7-
partial class A
8+
partial class TwoPartClass
89
{
9-
partial void M() { }
10-
public void M3() { }
10+
partial void PartialMethodWithBody1() { }
11+
public void Method3() { }
1112
}
13+
14+
partial class OnePartPartialClass
15+
{
16+
partial void PartialMethodWithoutBody2();
17+
public void Method4() { }
18+
}
19+
20+
class NonPartialClass
21+
{
22+
public void Method5() { }
23+
}
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
| Partial.cs:1:15:1:15 | A |
2-
| Partial.cs:3:18:3:18 | M |
3-
| Partial.cs:7:15:7:15 | A |
1+
| Partial.cs:1:15:1:26 | TwoPartClass |
2+
| Partial.cs:3:18:3:39 | PartialMethodWithBody1 |
3+
| Partial.cs:4:18:4:42 | PartialMethodWithoutBody1 |
4+
| Partial.cs:8:15:8:26 | TwoPartClass |
5+
| Partial.cs:14:15:14:33 | OnePartPartialClass |
6+
| Partial.cs:16:18:16:42 | PartialMethodWithoutBody2 |
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
| Partial.cs:1:15:1:15 | A | Partial.cs:3:18:3:18 | M |
2-
| Partial.cs:1:15:1:15 | A | Partial.cs:4:17:4:18 | M2 |
3-
| Partial.cs:1:15:1:15 | A | Partial.cs:10:17:10:18 | M3 |
4-
| Partial.cs:7:15:7:15 | A | Partial.cs:3:18:3:18 | M |
5-
| Partial.cs:7:15:7:15 | A | Partial.cs:4:17:4:18 | M2 |
6-
| Partial.cs:7:15:7:15 | A | Partial.cs:10:17:10:18 | M3 |
1+
| Partial.cs:1:15:1:26 | TwoPartClass | Partial.cs:3:18:3:39 | PartialMethodWithBody1 |
2+
| Partial.cs:1:15:1:26 | TwoPartClass | Partial.cs:4:18:4:42 | PartialMethodWithoutBody1 |
3+
| Partial.cs:1:15:1:26 | TwoPartClass | Partial.cs:5:17:5:23 | Method2 |
4+
| Partial.cs:1:15:1:26 | TwoPartClass | Partial.cs:11:17:11:23 | Method3 |
5+
| Partial.cs:8:15:8:26 | TwoPartClass | Partial.cs:3:18:3:39 | PartialMethodWithBody1 |
6+
| Partial.cs:8:15:8:26 | TwoPartClass | Partial.cs:4:18:4:42 | PartialMethodWithoutBody1 |
7+
| Partial.cs:8:15:8:26 | TwoPartClass | Partial.cs:5:17:5:23 | Method2 |
8+
| Partial.cs:8:15:8:26 | TwoPartClass | Partial.cs:11:17:11:23 | Method3 |
9+
| Partial.cs:14:15:14:33 | OnePartPartialClass | Partial.cs:16:18:16:42 | PartialMethodWithoutBody2 |
10+
| Partial.cs:14:15:14:33 | OnePartPartialClass | Partial.cs:17:17:17:23 | Method4 |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| Partial.cs:3:18:3:39 | PartialMethodWithBody1 | true |
2+
| Partial.cs:4:18:4:42 | PartialMethodWithoutBody1 | false |
3+
| Partial.cs:16:18:16:42 | PartialMethodWithoutBody2 | false |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import csharp
2+
3+
private boolean hasBody(Method m) { if m.hasBody() then result = true else result = false }
4+
5+
from Method m
6+
where m.fromSource() and m.isPartial()
7+
select m, hasBody(m)

0 commit comments

Comments
 (0)