| Index: tests/lib/math/random_test.dart
|
| ===================================================================
|
| --- tests/lib/math/random_test.dart (revision 23308)
|
| +++ tests/lib/math/random_test.dart (working copy)
|
| @@ -14,38 +14,38 @@
|
| var rnd = new Random(20130307);
|
| // Make sure we do not break the random number generation.
|
| var i = 0;
|
| - Expect.equals( 0, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 2, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 1, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 1, rnd.nextInt(1 << ++i));
|
| Expect.equals( 7, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 8, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 1, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 61, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 31, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 230, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 390, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 443, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 1931, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 3028, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 5649, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 4603, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 27684, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 54139, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 83454, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 106708, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 112143, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 875266, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 971126, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 1254573, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 4063839, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 7854646, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 29593843, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 17672573, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 80223657, rnd.nextInt(1 << ++i));
|
| - Expect.equals( 142194155, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 6, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 6, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 59, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 11, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 212, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 17, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 507, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 1060, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 891, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 1534, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 8404, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 13839, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 23298, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 53622, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 205997, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 393823, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 514614, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 233715, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 895357, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 4726185, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 7976427, rnd.nextInt(1 << ++i));
|
| Expect.equals( 31792146, rnd.nextInt(1 << ++i));
|
| - Expect.equals(1042196170, rnd.nextInt(1 << ++i));
|
| - Expect.equals(1589656273, rnd.nextInt(1 << ++i));
|
| - Expect.equals(1547294578, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 35563210, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 113261265, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 205117298, rnd.nextInt(1 << ++i));
|
| + Expect.equals( 447729735, rnd.nextInt(1 << ++i));
|
| + Expect.equals(1072507596, rnd.nextInt(1 << ++i));
|
| + Expect.equals(2134030067, rnd.nextInt(1 << ++i));
|
| + Expect.equals(721180690, rnd.nextInt(1 << ++i));
|
| Expect.equals(32, i);
|
| // If max is too large expect an ArgumentError.
|
| Expect.throws(() => rnd.nextInt((1 << i)+1), (e) => e is ArgumentError);
|
|
|