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

Side by Side Diff: tests/corelib/collection_to_string_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated latest tests. 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 for the toString methods on collections and maps. 6 * Tests for the toString methods on collections and maps.
7 */ 7 */
8 8
9 library collection_to_string; 9 library collection_to_string;
10 10
11 import "package:expect/expect.dart";
11 import 'dart:collection' show Queue, LinkedHashMap; 12 import 'dart:collection' show Queue, LinkedHashMap;
12 import 'dart:math' as Math; 13 import 'dart:math' as Math;
13 14
14 // TODO(jjb): seed random number generator when API allows it 15 // TODO(jjb): seed random number generator when API allows it
15 16
16 const int NUM_TESTS = 300; 17 const int NUM_TESTS = 300;
17 const int MAX_COLLECTION_SIZE = 7; 18 const int MAX_COLLECTION_SIZE = 7;
18 19
19 Math.Random rand; 20 Math.Random rand;
20 21
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 return rand.nextBool(); 298 return rand.nextBool();
298 } 299 }
299 300
300 /** Returns the alphabetized characters in a string. */ 301 /** Returns the alphabetized characters in a string. */
301 String alphagram(String s) { 302 String alphagram(String s) {
302 // Calling [toList] to convert unmodifiable list to normal list. 303 // Calling [toList] to convert unmodifiable list to normal list.
303 List<int> chars = s.codeUnits.toList(); 304 List<int> chars = s.codeUnits.toList();
304 chars.sort((int a, int b) => a - b); 305 chars.sort((int a, int b) => a - b);
305 return new String.fromCharCodes(chars); 306 return new String.fromCharCodes(chars);
306 } 307 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698