Skip to content

Commit 93baed9

Browse files
authored
[material_ui] Port flutter/flutter flutter#186777 MaterialColor test (flutter#12858)
This PR ports the Material-specific test from [flutter#186777](flutter#186777) to `material_ui`. The `MaterialColor swatch comparison` test verifies equality for separate swatch maps containing the same standard `Color` values. This is a test-only port, so no package version or changelog entry is needed. Part of [flutter#188444](flutter#188444). The PR that removes the test in the framework is flutter#192716
1 parent 83c3b82 commit 93baed9

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎packages/material_ui/test/colors_test.dart‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,14 @@ void main() {
8383
}
8484
}
8585
});
86+
87+
test('MaterialColor swatch comparison', () {
88+
final sampleMap = <int, Color>{50: const Color(0xFFE1F5FE), 100: const Color(0xFFB3E5FC)};
89+
final anotherMap = <int, Color>{50: const Color(0xFFE1F5FE), 100: const Color(0xFFB3E5FC)};
90+
final first = MaterialColor(0, sampleMap);
91+
final second = MaterialColor(0, sampleMap);
92+
final third = MaterialColor(0, anotherMap);
93+
expect(first, second);
94+
expect(first, third);
95+
});
8696
}

0 commit comments

Comments
 (0)