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

Unified Diff: tests/corelib/integer_to_radix_string_test.dart

Issue 87523003: Change dart2js int.toRadixString to not return spurious format on IE. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update CL Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib/corelib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/integer_to_radix_string_test.dart
diff --git a/tests/corelib/integer_to_radix_string_test.dart b/tests/corelib/integer_to_radix_string_test.dart
index 34db6fb2f8aaea6b9f1a6c4be4843242c2ad78d7..5ebd7e09106cf32dd86c9aab77ac618b922d32be 100644
--- a/tests/corelib/integer_to_radix_string_test.dart
+++ b/tests/corelib/integer_to_radix_string_test.dart
@@ -11,7 +11,7 @@ main() {
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z'];
- for (var radix = 2; radix < 37; radix++) {
+ for (var radix = 2; radix <= 36; radix++) {
for (var i = 0; i < radix; i++) {
Expect.equals(expected[i], i.toRadixString(radix));
}
@@ -26,4 +26,29 @@ main() {
// Nothing to do.
}
}
+
+ // Try large numbers (regression test for issue 15316).
+ var bignums = [
+ 0x80000000,
+ 0x100000000,
+ 0x10000000000000,
+ 0x10000000000001, // 53 significant bits.
+ 0x20000000000000,
+ 0x20000000000002,
+ 0x1000000000000000,
+ 0x1000000000000100,
+ 0x2000000000000000,
+ 0x2000000000000200,
+ 0x8000000000000000,
+ 0x8000000000000800,
+ 0x10000000000000000,
+ 0x10000000000001000,
+ ];
+ for (var bignum in bignums) {
+ for (int radix = 2; radix <= 36; radix++) {
+ String digits = bignum.toRadixString(radix);
+ int result = int.parse(digits, radix: radix);
+ Expect.equals(bignum, result, "$bignum -> $digits/$radix");
+ }
+ }
}
« no previous file with comments | « tests/corelib/corelib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698