Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Unified Diff: pkg/intl/test/date_time_format_test_core.dart

Issue 23494030: Fix off-by-one error in computing the quarter in date formatting (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/intl/lib/src/date_format_field.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/test/date_time_format_test_core.dart
diff --git a/pkg/intl/test/date_time_format_test_core.dart b/pkg/intl/test/date_time_format_test_core.dart
index d4a03c1d0dcffc5743f2623599896be413f62ec4..b39372d8749444813abc71ef2a8cb20c60d80a88 100644
--- a/pkg/intl/test/date_time_format_test_core.dart
+++ b/pkg/intl/test/date_time_format_test_core.dart
@@ -355,4 +355,18 @@ void runDateTests(Function subsetFunc) {
var symbols = emptyFormat.dateSymbols;
expect(symbols.NARROWWEEKDAYS, ['S', 'M', 'T', 'W', 'T', 'F', 'S']);
});
-}
+
+ test('Quarter calculation', () {
+ var quarters = ['Q1', 'Q1', 'Q1',
+ 'Q2', 'Q2', 'Q2',
+ 'Q3', 'Q3', 'Q3',
+ 'Q4', 'Q4', 'Q4'];
+ var quarterFormat = new DateFormat.QQQ();
+ for (int i = 0; i < 12; i++) {
+ var month = i + 1;
+ var aDate = new DateTime(2012, month, 27, 13, 58, 59, 012);
+ var formatted = quarterFormat.format(aDate);
+ expect(formatted, quarters[i]);
+ }
+ });
+}
« no previous file with comments | « pkg/intl/lib/src/date_format_field.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698