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('../../../pkg/i18n/intl.dart'); | 9 #import('../../../pkg/i18n/intl.dart'); |
10 #import('../../../pkg/i18n/date_format.dart'); | 10 #import('../../../pkg/i18n/date_format.dart'); |
11 #import('../../../lib/unittest/unittest.dart'); | 11 #import('../../../pkg/unittest/unittest.dart'); |
12 #import('../../../pkg/i18n/date_time_patterns.dart'); | 12 #import('../../../pkg/i18n/date_time_patterns.dart'); |
13 #import('../../../pkg/i18n/date_symbol_data.dart'); | 13 #import('../../../pkg/i18n/date_symbol_data.dart'); |
14 | 14 |
15 #source('date_time_format_test_data.dart'); | 15 #source('date_time_format_test_data.dart'); |
16 | 16 |
17 /** | 17 /** |
18 * Tests the DateFormat library in dart. | 18 * Tests the DateFormat library in dart. |
19 */ | 19 */ |
20 | 20 |
21 var formatsToTest = const [ | 21 var formatsToTest = const [ |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 var localPrinted = format.format(local); | 288 var localPrinted = format.format(local); |
289 var parsed = format.parse(localPrinted); | 289 var parsed = format.parse(localPrinted); |
290 var parsedUTC = format.parseUTC(format.format(utc)); | 290 var parsedUTC = format.parseUTC(format.format(utc)); |
291 var parsedOffset = parsedUTC.millisecondsSinceEpoch | 291 var parsedOffset = parsedUTC.millisecondsSinceEpoch |
292 - parsed.millisecondsSinceEpoch; | 292 - parsed.millisecondsSinceEpoch; |
293 expect(parsedOffset, equals(offset)); | 293 expect(parsedOffset, equals(offset)); |
294 expect(utc.hour, equals(parsedUTC.hour)); | 294 expect(utc.hour, equals(parsedUTC.hour)); |
295 expect(local.hour, equals(parsed.hour)); | 295 expect(local.hour, equals(parsed.hour)); |
296 }); | 296 }); |
297 } | 297 } |
OLD | NEW |