Skip to content

Commit f54fe93

Browse files
authored
[pigeon] Validates support for nested collections with generic types. (#7614)
Validates support for nested collections with generic types. Really just adds tests to ensure behavior. small step toward flutter/flutter#116117
1 parent d83d021 commit f54fe93

File tree

20 files changed

+1549
-415
lines changed

20 files changed

+1549
-415
lines changed

packages/pigeon/pigeons/core_tests.dart

+18
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,16 @@ class AllTypes {
5252
required this.enumList,
5353
required this.objectList,
5454
required this.listList,
55+
required this.mapList,
5556

5657
// Maps
5758
required this.map,
5859
required this.stringMap,
5960
required this.intMap,
6061
required this.enumMap,
6162
required this.objectMap,
63+
required this.listMap,
64+
required this.mapMap,
6265
});
6366

6467
bool aBool;
@@ -84,6 +87,7 @@ class AllTypes {
8487
List<AnEnum> enumList;
8588
List<Object> objectList;
8689
List<List<Object?>> listList;
90+
List<Map<Object?, Object?>> mapList;
8791

8892
// Maps
8993
// ignore: strict_raw_type, always_specify_types
@@ -92,6 +96,8 @@ class AllTypes {
9296
Map<int, int> intMap;
9397
Map<AnEnum, AnEnum> enumMap;
9498
Map<Object, Object> objectMap;
99+
Map<int, List<Object?>> listMap;
100+
Map<int, Map<Object?, Object?>> mapMap;
95101
}
96102

97103
/// A class containing all supported nullable types.
@@ -123,6 +129,7 @@ class AllNullableTypes {
123129
this.enumList,
124130
this.objectList,
125131
this.listList,
132+
this.mapList,
126133
this.recursiveClassList,
127134

128135
// Maps
@@ -131,6 +138,8 @@ class AllNullableTypes {
131138
this.intMap,
132139
this.enumMap,
133140
this.objectMap,
141+
this.listMap,
142+
this.mapMap,
134143
this.recursiveClassMap,
135144
);
136145

@@ -158,6 +167,7 @@ class AllNullableTypes {
158167
List<AnEnum?>? enumList;
159168
List<Object?>? objectList;
160169
List<List<Object?>?>? listList;
170+
List<Map<Object?, Object?>?>? mapList;
161171
List<AllNullableTypes?>? recursiveClassList;
162172

163173
// Maps
@@ -167,6 +177,8 @@ class AllNullableTypes {
167177
Map<int?, int?>? intMap;
168178
Map<AnEnum?, AnEnum?>? enumMap;
169179
Map<Object?, Object?>? objectMap;
180+
Map<int?, List<Object?>?>? listMap;
181+
Map<int?, Map<Object?, Object?>?>? mapMap;
170182
Map<int?, AllNullableTypes?>? recursiveClassMap;
171183
}
172184

@@ -199,13 +211,16 @@ class AllNullableTypesWithoutRecursion {
199211
this.enumList,
200212
this.objectList,
201213
this.listList,
214+
this.mapList,
202215

203216
// Maps
204217
this.map,
205218
this.stringMap,
206219
this.intMap,
207220
this.enumMap,
208221
this.objectMap,
222+
this.listMap,
223+
this.mapMap,
209224
);
210225

211226
bool? aNullableBool;
@@ -231,6 +246,7 @@ class AllNullableTypesWithoutRecursion {
231246
List<AnEnum?>? enumList;
232247
List<Object?>? objectList;
233248
List<List<Object?>?>? listList;
249+
List<Map<Object?, Object?>?>? mapList;
234250

235251
// Maps
236252
// ignore: strict_raw_type, always_specify_types
@@ -239,6 +255,8 @@ class AllNullableTypesWithoutRecursion {
239255
Map<int?, int?>? intMap;
240256
Map<AnEnum?, AnEnum?>? enumMap;
241257
Map<Object?, Object?>? objectMap;
258+
Map<int?, List<Object?>?>? listMap;
259+
Map<int?, Map<Object?, Object?>?>? mapMap;
242260
}
243261

244262
/// A class for testing nested class handling.

0 commit comments

Comments
 (0)