Fix number_format_test_core: don't terminate tests early for mismatching lists.
* All test are hereby tested.
* An informational message is printed when a locale is found in
number_symbols_data that lacks tests.
* Locales currently lacking tests: en_MY, fr_CH, it_CH and ps.
* The source list of locales for which unit tests are generated:
http://google3/i18n/tools/proto/closure_locales_data.txt
PiperOrigin-RevId: 274652634
diff --git a/test/number_format_test_core.dart b/test/number_format_test_core.dart
index e7932b8..b2961cd 100644
--- a/test/number_format_test_core.dart
+++ b/test/number_format_test_core.dart
@@ -70,13 +70,20 @@
var testLength = (testFormats.length * 3) + 1;
var list = mainList.take(testLength).iterator;
list.moveNext();
- mainList = mainList.skip(testLength).toList();
- // TODO(hugovdm): this if needs an else statement. Something to do with
- // Jurassic Park and amphibian DNA?
if (locale == list.current) {
+ mainList = mainList.skip(testLength).toList();
testAgainstIcu(locale, testFormats, list);
+ } else if (!numberFormatSymbols.containsKey(list.current)) {
+ throw Exception(
+ 'Test locale ${list.current} is lacking in numberFormatSymbols.');
+ } else {
+ print('No unit tests found in numberTestData for locale $locale.');
}
}
+ if (mainList[0] != 'END') {
+ throw Exception(
+ 'Test locale ${mainList[0]} is lacking in numberFormatSymbols.');
+ }
test('Simple set of numbers', () {
var number = NumberFormat();