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

Side by Side Diff: pkg/intl/test/date_time_format_test_core.dart

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 9 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
OLDNEW
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
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 */ 177 */
178 List oddLocales() { 178 List oddLocales() {
179 int i = 1; 179 int i = 1;
180 return allLocales().where((x) => (i++).isOdd).toList(); 180 return allLocales().where((x) => (i++).isOdd).toList();
181 } 181 }
182 182
183 /** 183 /**
184 * Return a set of a few locales to run just the tests on a small sample. 184 * Return a set of a few locales to run just the tests on a small sample.
185 */ 185 */
186 List smallSetOfLocales() { 186 List smallSetOfLocales() {
187 return allLocales().getRange(0,10); 187 return allLocales().sublist(0,10);
188 } 188 }
189 189
190 /** 190 /**
191 * Return only the even-numbered locales. A simple way to divide the list into 191 * Return only the even-numbered locales. A simple way to divide the list into
192 * two roughly equal parts. 192 * two roughly equal parts.
193 */ 193 */
194 List evenLocales() { 194 List evenLocales() {
195 int i = 1; 195 int i = 1;
196 return allLocales().where((x) => !((i++).isOdd)).toList(); 196 return allLocales().where((x) => !((i++).isOdd)).toList();
197 } 197 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 test('Test default format', () { 356 test('Test default format', () {
357 var someDate = new DateTime(2012, 1, 27, 20, 58, 59, 1); 357 var someDate = new DateTime(2012, 1, 27, 20, 58, 59, 1);
358 var emptyFormat = new DateFormat(null, "en_US"); 358 var emptyFormat = new DateFormat(null, "en_US");
359 var knownDefault = new DateFormat.yMMMMd("en_US").add_jms(); 359 var knownDefault = new DateFormat.yMMMMd("en_US").add_jms();
360 var result = emptyFormat.format(someDate); 360 var result = emptyFormat.format(someDate);
361 var knownResult = knownDefault.format(someDate); 361 var knownResult = knownDefault.format(someDate);
362 expect(result, knownResult); 362 expect(result, knownResult);
363 }); 363 });
364 } 364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698