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

Side by Side Diff: tests/lib/i18n/date_time_format_test.dart

Issue 10505005: Polish Date formatting API. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« lib/i18n/date_format.dart ('K') | « lib/i18n/date_time_format.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 * for details. All rights reserved. Use of this source code is governed by a 3 * for details. All rights reserved. Use of this source code is governed by a
4 * BSD-style license that can be found in the LICENSE file. 4 * BSD-style license that can be found in the LICENSE file.
5 */ 5 */
6 6
7 #library('date_time_format_test'); 7 #library('date_time_format_test');
8 8
9 #import('../../../lib/i18n/date_time_format.dart'); 9 #import('../../../lib/i18n/date_format.dart');
10 #import('../../../lib/unittest/unittest.dart'); 10 #import('../../../lib/unittest/unittest.dart');
11 11
12 /** 12 /**
13 * Tests the DateFormat library in dart. 13 * Tests the DateFormat library in dart.
14 */ 14 */
15 15
16 main() { 16 main() {
17 test('Date formatting', () { 17 test('Date formatting', () {
18 var date_format = new DateTimeFormat.fullDate(); 18 var date_format = new DateFormat.fullDate();
19 Date date = new Date.now(); 19 Date date = new Date.now();
20 // TODO(efortuna): Change the expectation once we have a functioning date 20 // TODO(efortuna): Change the expectation once we have a functioning date
21 // formatting class. 21 // formatting class.
22 Expect.stringEquals(date.toString(), date_format.format(date)); 22 Expect.stringEquals(date.toString(), date_format.format(date));
23 23
24 date_format = new DateTimeFormat("hh:mm:ss"); 24 date_format = new DateFormat("hh:mm:ss");
25 Expect.stringEquals(date.toString(), date_format.format(date)); 25 Expect.stringEquals(date.toString(), date_format.format(date));
26 }); 26 });
27 27
28 test('Date parsing', () { 28 test('Date parsing', () {
29 var date_format = new DateTimeFormat.fullDate(); 29 var date_format = new DateFormat.fullDate();
30 Date date = new Date.now(); 30 Date date = new Date.now();
31 // TODO(efortuna): Change the expectation once we have a functioning date 31 // TODO(efortuna): Change the expectation once we have a functioning date
32 // formatting class. 32 // formatting class.
33 Expect.stringEquals(date_format.parse(date.toString()), date.toString()); 33 Expect.stringEquals(date_format.parse(date.toString()), date.toString());
34 }); 34 });
35 } 35 }
OLDNEW
« lib/i18n/date_format.dart ('K') | « lib/i18n/date_time_format.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698