Skip to content

Commit

Permalink
[pigeon] Validates support for nested collections with generic types. (
Browse files Browse the repository at this point in the history
…#7614)

Validates support for nested collections with generic types.

Really just adds tests to ensure behavior. 

small step toward flutter/flutter#116117
  • Loading branch information
tarrinneal authored Sep 19, 2024
1 parent d83d021 commit f54fe93
Show file tree
Hide file tree
Showing 20 changed files with 1,549 additions and 415 deletions.
18 changes: 18 additions & 0 deletions packages/pigeon/pigeons/core_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ class AllTypes {
required this.enumList,
required this.objectList,
required this.listList,
required this.mapList,

// Maps
required this.map,
required this.stringMap,
required this.intMap,
required this.enumMap,
required this.objectMap,
required this.listMap,
required this.mapMap,
});

bool aBool;
Expand All @@ -84,6 +87,7 @@ class AllTypes {
List<AnEnum> enumList;
List<Object> objectList;
List<List<Object?>> listList;
List<Map<Object?, Object?>> mapList;

// Maps
// ignore: strict_raw_type, always_specify_types
Expand All @@ -92,6 +96,8 @@ class AllTypes {
Map<int, int> intMap;
Map<AnEnum, AnEnum> enumMap;
Map<Object, Object> objectMap;
Map<int, List<Object?>> listMap;
Map<int, Map<Object?, Object?>> mapMap;
}

/// A class containing all supported nullable types.
Expand Down Expand Up @@ -123,6 +129,7 @@ class AllNullableTypes {
this.enumList,
this.objectList,
this.listList,
this.mapList,
this.recursiveClassList,

// Maps
Expand All @@ -131,6 +138,8 @@ class AllNullableTypes {
this.intMap,
this.enumMap,
this.objectMap,
this.listMap,
this.mapMap,
this.recursiveClassMap,
);

Expand Down Expand Up @@ -158,6 +167,7 @@ class AllNullableTypes {
List<AnEnum?>? enumList;
List<Object?>? objectList;
List<List<Object?>?>? listList;
List<Map<Object?, Object?>?>? mapList;
List<AllNullableTypes?>? recursiveClassList;

// Maps
Expand All @@ -167,6 +177,8 @@ class AllNullableTypes {
Map<int?, int?>? intMap;
Map<AnEnum?, AnEnum?>? enumMap;
Map<Object?, Object?>? objectMap;
Map<int?, List<Object?>?>? listMap;
Map<int?, Map<Object?, Object?>?>? mapMap;
Map<int?, AllNullableTypes?>? recursiveClassMap;
}

Expand Down Expand Up @@ -199,13 +211,16 @@ class AllNullableTypesWithoutRecursion {
this.enumList,
this.objectList,
this.listList,
this.mapList,

// Maps
this.map,
this.stringMap,
this.intMap,
this.enumMap,
this.objectMap,
this.listMap,
this.mapMap,
);

bool? aNullableBool;
Expand All @@ -231,6 +246,7 @@ class AllNullableTypesWithoutRecursion {
List<AnEnum?>? enumList;
List<Object?>? objectList;
List<List<Object?>?>? listList;
List<Map<Object?, Object?>?>? mapList;

// Maps
// ignore: strict_raw_type, always_specify_types
Expand All @@ -239,6 +255,8 @@ class AllNullableTypesWithoutRecursion {
Map<int?, int?>? intMap;
Map<AnEnum?, AnEnum?>? enumMap;
Map<Object?, Object?>? objectMap;
Map<int?, List<Object?>?>? listMap;
Map<int?, Map<Object?, Object?>?>? mapMap;
}

/// A class for testing nested class handling.
Expand Down
Loading

0 comments on commit f54fe93

Please sign in to comment.