Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
LongCatIsLooong committed Sep 2, 2022
1 parent 0db3634 commit 50f2474
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/flutter/test/material/typography_test.dart
Expand Up @@ -101,6 +101,26 @@ void main() {
expect(nonDefaultPropertyNames, <String>['black', 'white', 'englishLike', 'dense', 'tall']);
});

test('Can lerp between different typographies', () {
final List<Typography> all = <Typography>[
for (final TargetPlatform platform in TargetPlatform.values) Typography.material2014(platform: platform),
for (final TargetPlatform platform in TargetPlatform.values) Typography.material2018(platform: platform),
for (final TargetPlatform platform in TargetPlatform.values) Typography.material2021(platform: platform),
];

for (final Typography fromTypography in all) {
for (final Typography toTypegraphy in all) {
Object? error;
try {
Typography.lerp(fromTypography, toTypegraphy, 0.5);
} catch (e) {
error = e;
}
expect(error, isNull);
}
}
});

test('englishLike2018 TextTheme matches Material Design spec', () {
// Check the default material text theme against the style values
// shown https://material.io/design/typography/#type-scale.
Expand Down

0 comments on commit 50f2474

Please sign in to comment.