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 import "dart:math" show pow; | 6 import "dart:math" show pow; |
7 | 7 |
8 void main() { | 8 void main() { |
9 bool checkedMode = false; | 9 bool checkedMode = false; |
10 assert((checkedMode = true)); | 10 assert((checkedMode = true)); |
11 const String oneByteWhiteSpace = "\x09\x0a\x0b\x0c\x0d\x20" | 11 const String oneByteWhiteSpace = "\x09\x0a\x0b\x0c\x0d\x20" |
12 "\x85" /// 01: ok | 12 "\x85" /// 01: ok |
13 "\xa0"; | 13 "\xa0"; |
14 const String whiteSpace = "$oneByteWhiteSpace\u1680" | 14 const String whiteSpace = "$oneByteWhiteSpace\u1680\u180e" |
15 "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a" | 15 "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a" |
16 "\u2028\u2029\u202f\u205f\u3000\ufeff"; | 16 "\u2028\u2029\u202f\u205f\u3000\ufeff"; |
17 | 17 |
18 var digits = "0123456789abcdefghijklmnopqrstuvwxyz"; | 18 var digits = "0123456789abcdefghijklmnopqrstuvwxyz"; |
19 var zeros = "0" * 64; | 19 var zeros = "0" * 64; |
20 | 20 |
21 for (int i = 0; i < whiteSpace.length; i++) { | 21 for (int i = 0; i < whiteSpace.length; i++) { |
22 var ws = whiteSpace[i]; | 22 var ws = whiteSpace[i]; |
23 Expect.equals(0, int.parse("${ws}0${ws}", radix: 2)); | 23 Expect.equals(0, int.parse("${ws}0${ws}", radix: 2)); |
24 } | 24 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 testBadArguments("0", -1); | 133 testBadArguments("0", -1); |
134 testBadArguments("0", 0); | 134 testBadArguments("0", 0); |
135 testBadArguments("0", 1); | 135 testBadArguments("0", 1); |
136 testBadArguments("0", 37); | 136 testBadArguments("0", 37); |
137 | 137 |
138 // See also int_parse_radix_bad_handler_test.dart | 138 // See also int_parse_radix_bad_handler_test.dart |
139 } | 139 } |
140 | 140 |
141 bool isFail(e) => e == "FAIL"; | 141 bool isFail(e) => e == "FAIL"; |
OLD | NEW |