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

Unified Diff: tests/lib/math/math2_test.dart

Issue 11367087: Added nextIntRange to dartvm and dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: tests/lib/math/math2_test.dart
diff --git a/tests/lib/math/math2_test.dart b/tests/lib/math/math2_test.dart
index cf71142d7ca27305129c0e9ecdfe7e96b5c1d470..21ff940ff3f28f85c0634f39fa85e3a597a1feed 100644
--- a/tests/lib/math/math2_test.dart
+++ b/tests/lib/math/math2_test.dart
@@ -241,6 +241,12 @@ class MathLibraryTest {
Expect.equals(true, parseIntThrowsFormatException(" +0x100 "));
}
+ static void testRandom() {
+ math.Random r = new math.Random();
+ checkClose(5, r.nextIntRange(1, 10), 10);
floitsch 2013/11/18 13:36:03 checkClose is typed for doubles. This will throw i
+ checkClose(5, r.nextInt(10), 10);
+ }
+
static testMain() {
testConstants();
testSin();
@@ -255,6 +261,7 @@ class MathLibraryTest {
testExp();
testPow();
testParseInt();
+ testRandom();
}
}

Powered by Google App Engine
This is Rietveld 408576698