| OLD | NEW |
| 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 = [ | 10 var expected = [ |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 ]; | 86 ]; |
| 87 for (var bignum in bignums) { | 87 for (var bignum in bignums) { |
| 88 for (int radix = 2; radix <= 36; radix++) { | 88 for (int radix = 2; radix <= 36; radix++) { |
| 89 String digits = bignum.toRadixString(radix); | 89 String digits = bignum.toRadixString(radix); |
| 90 int result = int.parse(digits, radix: radix); | 90 int result = int.parse(digits, radix: radix); |
| 91 Expect.equals( | 91 Expect.equals( |
| 92 bignum, result, "${bignum.toRadixString(16)} -> $digits/$radix"); | 92 bignum, result, "${bignum.toRadixString(16)} -> $digits/$radix"); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 } | 95 } |
| OLD | NEW |