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

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

Issue 847773004: Update toRadixString test so that it fails on d8 too. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 main() { 7 main() {
8 // Test that we accept radix 2 to 36 and that we use lower-case 8 // Test that we accept radix 2 to 36 and that we use lower-case
9 // letters. 9 // letters.
10 var expected = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 10 var expected = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
(...skipping 25 matching lines...) Expand all
36 0x20000000000000, 36 0x20000000000000,
37 0x20000000000002, 37 0x20000000000002,
38 0x1000000000000000, 38 0x1000000000000000,
39 0x1000000000000100, 39 0x1000000000000100,
40 0x2000000000000000, 40 0x2000000000000000,
41 0x2000000000000200, 41 0x2000000000000200,
42 0x8000000000000000, 42 0x8000000000000000,
43 0x8000000000000800, 43 0x8000000000000800,
44 0x10000000000000000, 44 0x10000000000000000,
45 0x10000000000001000, 45 0x10000000000001000,
46 0x100000000000010000,
47 0x1000000000000100000,
48 0x10000000000001000000,
49 0x100000000000010000000,
50 0x1000000000000100000000,
51 0x10000000000001000000000,
46 ]; 52 ];
47 for (var bignum in bignums) { 53 for (var bignum in bignums) {
48 for (int radix = 2; radix <= 36; radix++) { 54 for (int radix = 2; radix <= 36; radix++) {
49 String digits = bignum.toRadixString(radix); 55 String digits = bignum.toRadixString(radix);
50 int result = int.parse(digits, radix: radix); 56 int result = int.parse(digits, radix: radix);
51 Expect.equals(bignum, result, "$bignum -> $digits/$radix"); 57 Expect.equals(bignum, result,
58 "${bignum.toRadixString(16)} -> $digits/$radix");
52 } 59 }
53 } 60 }
54 } 61 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698