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

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

Issue 988523002: Fix int.parse bug (dart2js version) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « sdk/lib/core/int.dart ('k') | tests/corelib/int_parse_radix_test.dart » ('j') | 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 void testFail(String source) { 109 void testFail(String source) {
110 var object = new Object(); 110 var object = new Object();
111 Expect.throws(() { 111 Expect.throws(() {
112 double.parse(source, (s) { 112 double.parse(source, (s) {
113 Expect.equals(source, s); 113 Expect.equals(source, s);
114 throw object; 114 throw object;
115 }); 115 });
116 }, (e) => identical(object, e), "Fail: '$source'"); 116 }, (e) => identical(object, e), "Fail: '$source'");
117 Expect.equals(1.5, double.parse(source, (s) => 1.5));
117 } 118 }
118 119
119 void main() { 120 void main() {
120 testDouble(0.0); 121 testDouble(0.0);
121 testDouble(5e-324); 122 testDouble(5e-324);
122 testDouble(2.225073858507201e-308); 123 testDouble(2.225073858507201e-308);
123 testDouble(2.2250738585072014e-308); 124 testDouble(2.2250738585072014e-308);
124 testDouble(0.49999999999999994); 125 testDouble(0.49999999999999994);
125 testDouble(0.5); 126 testDouble(0.5);
126 testDouble(0.50000000000000006); 127 testDouble(0.50000000000000006);
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 testFail("INFINITY"); 1149 testFail("INFINITY");
1149 testFail("1.#INF"); 1150 testFail("1.#INF");
1150 testFail("inf"); 1151 testFail("inf");
1151 testFail("nan"); 1152 testFail("nan");
1152 testFail("NAN"); 1153 testFail("NAN");
1153 testFail("1.#IND"); 1154 testFail("1.#IND");
1154 testFail("indef"); 1155 testFail("indef");
1155 testFail("qnan"); 1156 testFail("qnan");
1156 testFail("snan"); 1157 testFail("snan");
1157 } 1158 }
OLDNEW
« no previous file with comments | « sdk/lib/core/int.dart ('k') | tests/corelib/int_parse_radix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698