Chromium Code Reviews| Index: pkg/intl/test/date_time_format_test_core.dart |
| =================================================================== |
| --- pkg/intl/test/date_time_format_test_core.dart (revision 16450) |
| +++ pkg/intl/test/date_time_format_test_core.dart (working copy) |
| @@ -226,12 +226,15 @@ |
| test('Test ALL the supported formats on representative locales', () { |
| var aDate = new Date(2012, 1, 27, 20, 58, 59, 0); |
| - testLocale("en_US", English, aDate); |
| - testLocale("de_DE", German, aDate); |
| - testLocale("fr_FR", French, aDate); |
| - testLocale("ja_JP", Japanese, aDate); |
| - testLocale("el_GR", Greek, aDate); |
| - testLocale("de_AT", Austrian, aDate); |
| + if (subset.length > 1) { |
| + // Don't run if we have just one locale, so some of these won't be there. |
| + testLocale("en_US", English, aDate); |
|
Emily Fortuna
2012/12/21 23:30:23
can we pull this one out of the if block, since w
Alan Knight
2012/12/21 23:34:25
Done.
|
| + testLocale("de_DE", German, aDate); |
| + testLocale("fr_FR", French, aDate); |
| + testLocale("ja_JP", Japanese, aDate); |
| + testLocale("el_GR", Greek, aDate); |
| + testLocale("de_AT", Austrian, aDate); |
| + } |
| }); |
| test('Test round-trip parsing of dates', () { |
| @@ -251,6 +254,9 @@ |
| }); |
| test('Patterns and symbols have the same coverage',() { |
| + // Don't run if we have just one locale, so checking coverage isn't |
| + // very meaningful. |
| + if (subset.length <= 1) return; |
| var patterns = new List.from(dateTimePatterns.keys); |
| var compare = (a, b) => a.compareTo(b); |
| patterns.sort(compare); |
| @@ -265,16 +271,20 @@ |
| }); |
| test('Test malformed locales', () { |
| + // Don't run if we have just one locale, which may not include these. |
| + if (subset.length <= 1) return; |
| var aDate = new Date(2012, 1, 27, 20, 58, 59, 0); |
| // Austrian is a useful test locale here because it differs slightly |
| // from the generic "de" locale so we can tell the difference between |
| // correcting to "de_AT" and falling back to just "de". |
| - testLocale('de-AT', Austrian, aDate); |
| - testLocale('de_at', Austrian, aDate); |
| - testLocale('de-at', Austrian, aDate); |
| + testLocale('de-AT', Austrian, aDate); |
| + testLocale('de_at', Austrian, aDate); |
|
Emily Fortuna
2012/12/21 23:30:23
accidental indentation?
Alan Knight
2012/12/21 23:34:25
Done.
|
| + testLocale('de-at', Austrian, aDate); |
| }); |
| test('Test format creation via Intl', () { |
| + // Don't run if we have just one locale, which may not include these. |
| + if (subset.length <= 1) return; |
| var intl = new Intl('ja_JP'); |
| var instanceJP = intl.date('jms'); |
| var instanceUS = intl.date('jms', 'en_US'); |
| @@ -286,6 +296,8 @@ |
| }); |
| test('Test explicit format string', () { |
| + // Don't run if we have just one locale, which may not include these. |
| + if (subset.length <= 1) return; |
| var aDate = new Date(2012, 1, 27, 20, 58, 59, 0); |
| // An explicit format that doesn't conform to any skeleton |
| var us = new DateFormat(r'yy //// :D \\\\ dd:ss ^&@ M'); |