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

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

Issue 10832430: Allow multiple patterns for date formats (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/date_format.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.dart
===================================================================
--- pkg/intl/test/date_time_format_test.dart (revision 11110)
+++ pkg/intl/test/date_time_format_test.dart (working copy)
@@ -169,6 +169,20 @@
}
main() {
+ test('Multiple patterns', () {
+ var date = new Date.now();
+ var multiple1 = new DateFormat.yMd().jms();
+ var multiple2 = new DateFormat("yMd").jms();
+ var separate1 = new DateFormat.yMd();
+ var separate2 = new DateFormat.jms();
+ var separateFormat = "${separate1.format(date)} ${separate2.format(date)}";
+ expect(multiple1.format(date), equals(multiple2.format(date)));
+ expect(multiple1.format(date), equals(separateFormat));
+ var customPunctuation = new DateFormat("yMd").addPattern("jms",":::");
+ var custom = "${separate1.format(date)}:::${separate2.format(date)}";
+ expect(customPunctuation.format(date), equals(custom));
+ });
+
test('Basic date format parsing', () {
var date_format = new DateFormat("d");
expect(
« no previous file with comments | « pkg/intl/date_format.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698