alanknight | 8754d38 | 2017-10-13 13:59:14 -0700 | [diff] [blame] | 1 | // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | /// Test date formatting and parsing using custom locale data, which we get |
| 6 | /// from the local copy. |
Kevin Moore | f22f7b5 | 2021-06-07 10:54:37 -0700 | [diff] [blame] | 7 | import 'package:intl/date_symbol_data_custom.dart'; |
Dart Team | 795c490 | 2019-08-29 10:58:28 -0700 | [diff] [blame] | 8 | import 'package:intl/date_symbol_data_local.dart' as local_symbols; |
| 9 | import 'package:intl/date_time_patterns.dart' as local_patterns; |
alanknight | 8754d38 | 2017-10-13 13:59:14 -0700 | [diff] [blame] | 10 | |
Dart Team | 795c490 | 2019-08-29 10:58:28 -0700 | [diff] [blame] | 11 | import 'date_time_format_test_stub.dart'; |
| 12 | |
| 13 | void main() { |
| 14 | var symbols = local_symbols.dateTimeSymbolMap(); |
| 15 | var patterns = local_patterns.dateTimePatternMap(); |
alanknight | a9f1f36 | 2018-05-03 17:02:13 -0700 | [diff] [blame] | 16 | var locales = <String>[]; |
davidmorgan | 4d5c96c | 2020-08-26 15:58:57 +0000 | [diff] [blame] | 17 | symbols.keys.take(10).forEach((locale) => locales.add(locale)); |
alanknight | 8754d38 | 2017-10-13 13:59:14 -0700 | [diff] [blame] | 18 | // Force inclusion of locales that are hard-coded in tests. |
Dart Team | 795c490 | 2019-08-29 10:58:28 -0700 | [diff] [blame] | 19 | var requiredLocales = ['en_US', 'de', 'fr', 'ja', 'el', 'de_AT']; |
alanknight | 8754d38 | 2017-10-13 13:59:14 -0700 | [diff] [blame] | 20 | locales.addAll(requiredLocales); |
| 21 | for (var locale in locales) { |
Dart Team | 795c490 | 2019-08-29 10:58:28 -0700 | [diff] [blame] | 22 | print('initializing $locale'); |
alanknight | 8754d38 | 2017-10-13 13:59:14 -0700 | [diff] [blame] | 23 | initializeDateFormattingCustom( |
| 24 | locale: locale, symbols: symbols[locale], patterns: patterns[locale]); |
| 25 | } |
| 26 | runWith(() => locales, null, nullInitialization); |
| 27 | } |
| 28 | |
davidmorgan | 4d5c96c | 2020-08-26 15:58:57 +0000 | [diff] [blame] | 29 | Future<void> nullInitialization(String a, String b) => Future.value(); |