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

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

Issue 623073002: Fix wrong limit on list index in double.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | « runtime/lib/double_patch.dart ('k') | 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) 2014 the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014 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 "dart:math" show pow; 5 import "dart:math" show pow;
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 const whiteSpace = const [ 8 const whiteSpace = const [
9 "", 9 "",
10 "\x09", 10 "\x09",
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 "000000000000000000000000000000000000000000000000000" 263 "000000000000000000000000000000000000000000000000000"
264 "000000000000000000000000000000000000000000000000000" 264 "000000000000000000000000000000000000000000000000000"
265 "000000000000000000000000000000000000000000000000000" 265 "000000000000000000000000000000000000000000000000000"
266 "000000000000000000000000000000000000000000000000000" 266 "000000000000000000000000000000000000000000000000000"
267 "00022250738585072012", 2.2250738585072014e-308); 267 "00022250738585072012", 2.2250738585072014e-308);
268 268
269 testParse("0.49999999999999994", 0.49999999999999994); 269 testParse("0.49999999999999994", 0.49999999999999994);
270 testParse("0.49999999999999997219", 0.49999999999999994); 270 testParse("0.49999999999999997219", 0.49999999999999994);
271 testParse("0.49999999999999999", 0.5); 271 testParse("0.49999999999999999", 0.5);
272 272
273 // Edge cases of algorithm (e+-22/23).
274 testParse("1e22", 1e22);
275 testParse("1e23", 1e23);
276 testParse("1e-22", 1e-22);
277 testParse("1e-23", 1e-23);
278
273 testParseWhitespace("1", 1.0); 279 testParseWhitespace("1", 1.0);
274 testParseWhitespace("1.0", 1.0); 280 testParseWhitespace("1.0", 1.0);
275 testParseWhitespace("1e1", 10.0); 281 testParseWhitespace("1e1", 10.0);
276 testParseWhitespace(".1e1", 1.0); 282 testParseWhitespace(".1e1", 1.0);
277 testParseWhitespace("1.e1", 10.0); 283 testParseWhitespace("1.e1", 10.0);
278 testParseWhitespace("1e+1", 10.0); 284 testParseWhitespace("1e+1", 10.0);
279 testParseWhitespace("1e-1", 0.1); 285 testParseWhitespace("1e-1", 0.1);
280 286
281 // Negative tests - things not to allow. 287 // Negative tests - things not to allow.
282 288
(...skipping 30 matching lines...) Expand all
313 testFail("INFINITY"); 319 testFail("INFINITY");
314 testFail("1.#INF"); 320 testFail("1.#INF");
315 testFail("inf"); 321 testFail("inf");
316 testFail("nan"); 322 testFail("nan");
317 testFail("NAN"); 323 testFail("NAN");
318 testFail("1.#IND"); 324 testFail("1.#IND");
319 testFail("indef"); 325 testFail("indef");
320 testFail("qnan"); 326 testFail("qnan");
321 testFail("snan"); 327 testFail("snan");
322 } 328 }
OLDNEW
« no previous file with comments | « runtime/lib/double_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698