Unverified Commit b23f207e authored by Pierre-Louis's avatar Pierre-Louis Committed by GitHub

Improve `update_icons.dart` script (#93863)

* Update update_icons.dart

* formatting

* more formatting

* simplify safety checks

* add safety checks tests

* formatting

* update copyright

* naming

* revert copyright

* add `fontFamily` option

* tweak diff messages

* Update update_icons.dart

* don't exit if platform adaptive icon not found

* remove trailing spaces

* remove warning and fix insert_chart (outlined) dartdoc

* x

* add error message when exiting due to failed safety checkes

* fix icon reference

* fix rewrite for onetwothree
parent 1dc458b2
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:test/test.dart';
import '../update_icons.dart';
Map<String, String> codepointsA = <String, String>{
'airplane': '111',
'boat': '222',
};
Map<String, String> codepointsB = <String, String>{
'airplane': '333',
};
Map<String, String> codepointsC = <String, String>{
'airplane': '111',
'train': '444',
};
void main() {
group('safety checks', () {
test('superset', () {
expect(testIsSuperset(codepointsA, codepointsA), true);
expect(testIsSuperset(codepointsA, codepointsB), true);
expect(testIsSuperset(codepointsB, codepointsA), false);
});
test('stability', () {
expect(testIsStable(codepointsA, codepointsA), true);
expect(testIsStable(codepointsA, codepointsB), false);
expect(testIsStable(codepointsB, codepointsA), false);
expect(testIsStable(codepointsA, codepointsC), true);
expect(testIsStable(codepointsC, codepointsA), true);
});
});
}
This diff is collapsed.
......@@ -97,8 +97,7 @@ class PlatformAdaptiveIcons implements Icons {
///
/// Use with the [Icon] class to show specific icons.
///
/// Icons are identified by their name as listed below. **Do not use codepoints
/// directly, as they are subject to change.**
/// Icons are identified by their name as listed below, e.g. [Icons.airplanemode_on].
///
/// To use this class, make sure you set `uses-material-design: true` in your
/// project's `pubspec.yaml` file in the `flutter` section. This ensures that
......@@ -10287,7 +10286,7 @@ class Icons {
/// <i class="material-icons-round md-36">insert_chart</i> &#x2014; material icon named "insert chart" (round).
static const IconData insert_chart_rounded = IconData(0xf819, fontFamily: 'MaterialIcons');
/// <i class="material-icons md-36">insert_chart_outlined</i> &#x2014; material icon named "insert chart outlined".
/// <i class="material-icons-outlined md-36">insert_chart</i> &#x2014; material icon named "insert chart" (outlined).
static const IconData insert_chart_outlined = IconData(0xf12a, fontFamily: 'MaterialIcons');
/// <i class="material-icons-sharp md-36">insert_chart_outlined</i> &#x2014; material icon named "insert chart outlined" (sharp).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment