| OLD | NEW |
| (Empty) |
| 1 /** | |
| 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 | |
| 4 * BSD-style license that can be found in the LICENSE file. | |
| 5 */ | |
| 6 | |
| 7 #library('date_format_test'); | |
| 8 | |
| 9 #import('../../../lib/i18n/date_format.dart'); | |
| 10 #import('../../../lib/unittest/unittest.dart'); | |
| 11 | |
| 12 /** | |
| 13 * Tests the DateFormat library in dart. | |
| 14 */ | |
| 15 | |
| 16 main() { | |
| 17 test('Date formatting', () { | |
| 18 var date_format = new DateFormat.fullDate(); | |
| 19 Date date = new Date.now(); | |
| 20 // TODO(efortuna): Change the expectation once we have a functioning date | |
| 21 // formatting class. | |
| 22 Expect.stringEquals(date.toString(), date_format.format(date)); | |
| 23 | |
| 24 date_format = new DateFormat("hh:mm:ss"); | |
| 25 Expect.stringEquals(date.toString(), date_format.format(date)); | |
| 26 }); | |
| 27 | |
| 28 test('Date parsing', () { | |
| 29 var date_format = new DateFormat.fullDate(); | |
| 30 Date date = new Date.now(); | |
| 31 // TODO(efortuna): Change the expectation once we have a functioning date | |
| 32 // formatting class. | |
| 33 Expect.stringEquals(date_format.parse(date.toString()), date.toString()); | |
| 34 }); | |
| 35 } | |
| OLD | NEW |