OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Tests the DateFormat library in dart. This file contains core tests that | 6 * Tests the DateFormat library in dart. This file contains core tests that |
7 * are run regardless of where the locale data is found, so it doesn't expect to | 7 * are run regardless of where the locale data is found, so it doesn't expect to |
8 * be run on its own, but rather to be imported and run from another test file. | 8 * be run on its own, but rather to be imported and run from another test file. |
9 */ | 9 */ |
10 | 10 |
11 library date_time_format_tests; | 11 #library('date_time_format_tests'); |
12 | 12 |
13 import '../../../pkg/unittest/unittest.dart'; | 13 #import('../../../pkg/unittest/unittest.dart'); |
14 import 'date_time_format_test_data.dart'; | 14 #import('date_time_format_test_data.dart'); |
15 import '../lib/intl.dart'; | 15 #import('../lib/intl.dart'); |
16 import '../lib/src/date_format_internal.dart'; | 16 #import('../lib/src/date_format_internal.dart'); |
17 | 17 |
18 var formatsToTest = const [ | 18 var formatsToTest = const [ |
19 DateFormat.DAY, | 19 DateFormat.DAY, |
20 DateFormat.ABBR_WEEKDAY, | 20 DateFormat.ABBR_WEEKDAY, |
21 DateFormat.WEEKDAY, | 21 DateFormat.WEEKDAY, |
22 DateFormat.ABBR_STANDALONE_MONTH, | 22 DateFormat.ABBR_STANDALONE_MONTH, |
23 DateFormat.STANDALONE_MONTH, | 23 DateFormat.STANDALONE_MONTH, |
24 DateFormat.NUM_MONTH, | 24 DateFormat.NUM_MONTH, |
25 DateFormat.NUM_MONTH_DAY, | 25 DateFormat.NUM_MONTH_DAY, |
26 DateFormat.NUM_MONTH_WEEKDAY_DAY, | 26 DateFormat.NUM_MONTH_WEEKDAY_DAY, |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 338 |
339 test('Test default format', () { | 339 test('Test default format', () { |
340 var someDate = new Date(2012, 1, 27, 20, 58, 59, 1); | 340 var someDate = new Date(2012, 1, 27, 20, 58, 59, 1); |
341 var emptyFormat = new DateFormat(null, "en_US"); | 341 var emptyFormat = new DateFormat(null, "en_US"); |
342 var knownDefault = new DateFormat.yMMMMd("en_US").add_jms(); | 342 var knownDefault = new DateFormat.yMMMMd("en_US").add_jms(); |
343 var result = emptyFormat.format(someDate); | 343 var result = emptyFormat.format(someDate); |
344 var knownResult = knownDefault.format(someDate); | 344 var knownResult = knownDefault.format(someDate); |
345 expect(result, knownResult); | 345 expect(result, knownResult); |
346 }); | 346 }); |
347 } | 347 } |
OLD | NEW |