Skip to content

Commit 001d357

Browse files
committed
C#: Restructure test cases.
1 parent c5949fa commit 001d357

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

csharp/ql/test/utils/model-generator/typebasedflow/TypeBasedSummaries.cs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55

66
namespace Summaries;
77

8-
public class Theorems1<T> {
8+
public class TypeBasedSimple<T> {
99

1010
public T Prop {
1111
get { throw null; }
1212
set { throw null; }
1313
}
1414

15-
public Theorems1(T t) { throw null; }
15+
public TypeBasedSimple(T t) { throw null; }
1616

1717
public T Get() { throw null; }
1818

1919
public T Get(object x) { throw null; }
2020

2121
public T Id(T x) { throw null; }
2222

23-
public S Transform<S>(S x) { throw null; }
23+
public S Id<S>(S x) { throw null; }
2424

2525
public void Set(T x) { throw null; }
2626

2727
public void Set(int x, T y) { throw null; }
2828

29-
// No summary as S is unrelated to T
30-
public void Set<S>(S x) { throw null; }
29+
public void Set<S>(S x) { throw null; } // No summary as S is unrelated to T
30+
}
3131

32-
public IList<T> GetMany() { throw null; }
32+
public class TypeBasedComplex<T> {
3333

3434
public void AddMany(IEnumerable<T> xs) { throw null; }
3535

@@ -39,35 +39,37 @@ public T Prop {
3939

4040
public T2 Apply<T1,T2>(T1 x, Func<T1, T2> f) { throw null; }
4141

42-
public S Map<S>(Func<T, S> f) { throw null; }
42+
public TypeBasedComplex<T> FlatMap(Func<T, IEnumerable<T>> f) { throw null; }
4343

44-
public Theorems1<S> MapTheorem<S>(Func<T, S> f) { throw null; }
44+
public TypeBasedComplex<S> FlatMap<S>(Func<T, IEnumerable<S>> f) { throw null; }
4545

46-
public Theorems1<S> FlatMap<S>(Func<T, IEnumerable<S>> f) { throw null; }
46+
public IList<T> GetMany() { throw null; }
4747

48-
public Theorems1<T> FlatMap(Func<T, IEnumerable<T>> f) { throw null; }
48+
public S Map<S>(Func<T, S> f) { throw null; }
49+
50+
public TypeBasedComplex<S> MapComplex<S>(Func<T, S> f) { throw null; }
4951

50-
public Theorems1<T> Return(Func<T, Theorems1<T>> f) { throw null; }
52+
public TypeBasedComplex<T> Return(Func<T, TypeBasedComplex<T>> f) { throw null; }
5153
// Examples still not working:
5254
// public void Set(int x, Func<int, T> f) { throw null;}
5355
}
5456

5557
// It is assumed that this is a collection with elements of type T.
56-
public class CollectionTheorems1<T> : IEnumerable<T> {
58+
public class TypeBasedCollection<T> : IEnumerable<T> {
5759
IEnumerator<T> IEnumerable<T>.GetEnumerator() { throw null; }
5860
IEnumerator IEnumerable.GetEnumerator() { throw null; }
5961

60-
public T First() { throw null; }
61-
6262
public void Add(T x) { throw null; }
6363

64-
public ICollection<T> GetMany() { throw null; }
65-
6664
public void AddMany(IEnumerable<T> x) { throw null; }
65+
66+
public T First() { throw null; }
67+
68+
public ICollection<T> GetMany() { throw null; }
6769
}
6870

6971
// It is assumed that this is NOT a collection with elements of type T.
70-
public class CollectionTheorems2<T> : IEnumerable {
72+
public class TypeBasedNoCollection<T> : IEnumerable {
7173
IEnumerator IEnumerable.GetEnumerator() { throw null; }
7274

7375
public T Get() { throw null; }

0 commit comments

Comments
 (0)