OLD | NEW |
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 } |
OLD | NEW |