Skip to content

Commit 4f4bf59

Browse files
committed
C#: Add tuple member tests
1 parent f73960d commit 4f4bf59

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
3+
public class Program
4+
{
5+
public static void Main()
6+
{
7+
var x = (1, 2);
8+
Console.WriteLine(x.GetType());
9+
x = new ValueTuple<int, int>(1, 2);
10+
Console.WriteLine(x.GetType());
11+
12+
var y = (1, 2, 3, 4, 5, 6, 7);
13+
Console.WriteLine(y.GetType());
14+
15+
var z = (1, 2, 3, 4, 5, 6, 7, 8);
16+
Console.WriteLine(z.GetType());
17+
18+
var w = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
19+
Console.WriteLine(w.GetType());
20+
}
21+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
members1
2+
| tuple.cs:7:17:7:22 | (Int32,Int32) | CompareTo((int, int)) |
3+
| tuple.cs:7:17:7:22 | (Int32,Int32) | CompareTo(object) |
4+
| tuple.cs:7:17:7:22 | (Int32,Int32) | CompareTo(object, IComparer) |
5+
| tuple.cs:7:17:7:22 | (Int32,Int32) | Equals((int, int)) |
6+
| tuple.cs:7:17:7:22 | (Int32,Int32) | Equals(object) |
7+
| tuple.cs:7:17:7:22 | (Int32,Int32) | Equals(object, IEqualityComparer) |
8+
| tuple.cs:7:17:7:22 | (Int32,Int32) | GetHashCode() |
9+
| tuple.cs:7:17:7:22 | (Int32,Int32) | GetHashCode(IEqualityComparer) |
10+
| tuple.cs:7:17:7:22 | (Int32,Int32) | Item1 |
11+
| tuple.cs:7:17:7:22 | (Int32,Int32) | Item2 |
12+
| tuple.cs:7:17:7:22 | (Int32,Int32) | Item[int] |
13+
| tuple.cs:7:17:7:22 | (Int32,Int32) | Length |
14+
| tuple.cs:7:17:7:22 | (Int32,Int32) | ToString() |
15+
| tuple.cs:7:17:7:22 | (Int32,Int32) | ToStringEnd() |
16+
| tuple.cs:7:17:7:22 | (Int32,Int32) | ValueTuple() |
17+
| tuple.cs:7:17:7:22 | (Int32,Int32) | ValueTuple(int, int) |
18+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo((int, int, int, int, int, int, int)) |
19+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo(object) |
20+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo(object, IComparer) |
21+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals((int, int, int, int, int, int, int)) |
22+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals(object) |
23+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals(object, IEqualityComparer) |
24+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | GetHashCode() |
25+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | GetHashCode(IEqualityComparer) |
26+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item1 |
27+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item2 |
28+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item3 |
29+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item4 |
30+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item5 |
31+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item6 |
32+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item7 |
33+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item[int] |
34+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Length |
35+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ToString() |
36+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ToStringEnd() |
37+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ValueTuple() |
38+
| tuple.cs:12:17:12:37 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ValueTuple(int, int, int, int, int, int, int) |
39+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo((int, int, int, int, int, int, int, int)) |
40+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo(object) |
41+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo(object, IComparer) |
42+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals((int, int, int, int, int, int, int, int)) |
43+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals(object) |
44+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals(object, IEqualityComparer) |
45+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | GetHashCode() |
46+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | GetHashCode(IEqualityComparer) |
47+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item1 |
48+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item2 |
49+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item3 |
50+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item4 |
51+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item5 |
52+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item6 |
53+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item7 |
54+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item8 |
55+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item[int] |
56+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Length |
57+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Rest |
58+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ToString() |
59+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ToStringEnd() |
60+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ValueTuple() |
61+
| tuple.cs:15:17:15:40 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ValueTuple(int, int, int, int, int, int, int, (int)) |
62+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo((int, int, int, int, int, int, int, int, int, int)) |
63+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo(object) |
64+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | CompareTo(object, IComparer) |
65+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals((int, int, int, int, int, int, int, int, int, int)) |
66+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals(object) |
67+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Equals(object, IEqualityComparer) |
68+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | GetHashCode() |
69+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | GetHashCode(IEqualityComparer) |
70+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item1 |
71+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item2 |
72+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item3 |
73+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item4 |
74+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item5 |
75+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item6 |
76+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item7 |
77+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item8 |
78+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item9 |
79+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item10 |
80+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Item[int] |
81+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Length |
82+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | Rest |
83+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ToString() |
84+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ToStringEnd() |
85+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ValueTuple() |
86+
| tuple.cs:18:17:18:47 | (Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32,Int32) | ValueTuple(int, int, int, int, int, int, int, (int, int, int)) |
87+
members2
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import csharp
2+
3+
query predicate members1(TupleType t, string m) {
4+
t.fromSource() and
5+
m = t.getAMember().toStringWithTypes()
6+
}
7+
8+
query predicate members2(TupleType t, string s, string m) {
9+
t.fromSource() and
10+
s = t.getUnderlyingType().toStringWithTypes() and
11+
m = t.getUnderlyingType().getAMember().toStringWithTypes()
12+
}

0 commit comments

Comments
 (0)