| Index: tests/corelib/src/CollectionToStringTest.dart
|
| ===================================================================
|
| --- tests/corelib/src/CollectionToStringTest.dart (revision 4345)
|
| +++ tests/corelib/src/CollectionToStringTest.dart (working copy)
|
| @@ -9,7 +9,7 @@
|
| // TODO(jjb): seed random number generator when API allows it
|
|
|
| final int NUM_TESTS = 3000;
|
| -final int MAX_COLLECTION_SIZE = 6;
|
| +final int MAX_COLLECTION_SIZE = 7;
|
|
|
| main() {
|
| smokeTest();
|
| @@ -68,9 +68,8 @@
|
| void exactTest() {
|
| for (int i = 0; i < NUM_TESTS; i++) {
|
| // Choose a size from 0 to MAX_COLLECTION_SIZE, favoring larger sizes
|
| - float sqrtSize = Math.sqrt(Math.random() * (MAX_COLLECTION_SIZE + 1));
|
| - int size = (sqrtSize * sqrtSize).toInt();
|
| -
|
| + int size = Math.sqrt(random(MAX_COLLECTION_SIZE * MAX_COLLECTION_SIZE)).toInt();
|
| +
|
| StringBuffer stringRep = new StringBuffer();
|
| Object o = randomCollection(size, stringRep, exact:true);
|
| Expect.equals(o.toString(), stringRep.toString());
|
| @@ -91,9 +90,8 @@
|
| void inexactTest() {
|
| for (int i = 0; i < NUM_TESTS; i++) {
|
| // Choose a size from 0 to MAX_COLLECTION_SIZE, favoring larger sizes
|
| - float sqrtSize = Math.sqrt(Math.random() * (MAX_COLLECTION_SIZE + 1));
|
| - int size = (sqrtSize * sqrtSize).toInt();
|
| -
|
| + int size = Math.sqrt(random(MAX_COLLECTION_SIZE * MAX_COLLECTION_SIZE)).toInt();
|
| +
|
| StringBuffer stringRep = new StringBuffer();
|
| Object o = randomCollection(size, stringRep, exact:false);
|
| Expect.equals(alphagram(o.toString()), alphagram(stringRep.toString()));
|
|
|