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

Unified Diff: tests/lib_strong/math/math_parse_double_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: tests/lib_strong/math/math_parse_double_test.dart
diff --git a/tests/lib_strong/math/math_parse_double_test.dart b/tests/lib_strong/math/math_parse_double_test.dart
index 9b122a737797d7c4de6396dd715aa6a6871e3fdd..0c00a7ac19a169745b9a2f84fb9974321ec72d5d 100644
--- a/tests/lib_strong/math/math_parse_double_test.dart
+++ b/tests/lib_strong/math/math_parse_double_test.dart
@@ -6,6 +6,7 @@
// class. This can easily be simplified once we get rid of the Math
// class entirely.
library math_parse_double_test;
+
import "package:expect/expect.dart";
void parseDoubleThrowsFormatException(str) {
@@ -37,53 +38,54 @@ void runTest(double expected, String input) {
}
final TESTS = [
- [ 499.0, "499" ],
- [ 499.0, "499." ],
- [ 499.0, "499.0" ],
- [ 0.0, "0" ],
- [ 0.0, ".0" ],
- [ 0.0, "0." ],
- [ 0.1, "0.1" ],
- [ 0.1, ".1" ],
- [ 10.0, "010" ],
- [ 1.5, "1.5" ],
- [ 1.5, "001.5" ],
- [ 1.5, "1.500" ],
- [ 1234567.89, "1234567.89" ],
- [ 1234567e89, "1234567e89" ],
- [ 1234567.89e2, "1234567.89e2" ],
- [ 1234567.89e2, "1234567.89e+2" ],
- [ 1234567.89e-2, "1234567.89e-2" ],
- [ 5.0, "5" ],
- [ 123456700.0, "1234567.e2" ],
- [ 123456700.0, "1234567.e+2" ],
- [ double.INFINITY, "Infinity" ],
- [ 5e-324, "5e-324" ], // min-pos.
+ [499.0, "499"],
+ [499.0, "499."],
+ [499.0, "499.0"],
+ [0.0, "0"],
+ [0.0, ".0"],
+ [0.0, "0."],
+ [0.1, "0.1"],
+ [0.1, ".1"],
+ [10.0, "010"],
+ [1.5, "1.5"],
+ [1.5, "001.5"],
+ [1.5, "1.500"],
+ [1234567.89, "1234567.89"],
+ [1234567e89, "1234567e89"],
+ [1234567.89e2, "1234567.89e2"],
+ [1234567.89e2, "1234567.89e+2"],
+ [1234567.89e-2, "1234567.89e-2"],
+ [5.0, "5"],
+ [123456700.0, "1234567.e2"],
+ [123456700.0, "1234567.e+2"],
+ [double.INFINITY, "Infinity"],
+ [5e-324, "5e-324"], // min-pos.
// Same, without exponential.
- [ 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625,
- "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625" ],
- [ 0.0, "2e-324" ], // underflow 0.0
- [ 0.9999999999999999, "0.9999999999999999" ], // max below 1
- [ 1.0, "1.00000000000000005" ], // 1.0
- [ 1.0000000000000002, "1.0000000000000002" ], // min above 1
- [ 2147483647.0, "2147483647" ], // max int32
- [ 2147483647.0000002, "2147483647.0000002" ], // min not int32
- [ 2147483648.0, "2147483648" ], // min int not int32
- [ 4295967295.0, "4295967295" ], // max uint32
- [ 4295967295.000001, "4295967295.000001" ], // min not uint-32
- [ 4295967296.0, "4295967296" ], // min int not-uint32
- [ 1.7976931348623157e+308, "1.7976931348623157e+308" ], // Max finit
- [ 1.7976931348623157e+308, "1.7976931348623158e+308" ], // Max finit
- [ double.INFINITY, "1.7976931348623159e+308" ], // Infinity
- [ .049999999999999994, ".049999999999999994" ], // not 0.5
- [ .05, ".04999999999999999935" ],
- [ 4503599627370498.0, "4503599627370497.5" ],
- [ 1.2345678901234568e+39, "1234567890123456898981341324213421342134" ],
- [ 9.87291183742987e+24, "9872911837429871193379121" ],
- [ 1e21, "1e+21" ],
+ [
+ 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625,
+ "0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625"
+ ],
+ [0.0, "2e-324"], // underflow 0.0
+ [0.9999999999999999, "0.9999999999999999"], // max below 1
+ [1.0, "1.00000000000000005"], // 1.0
+ [1.0000000000000002, "1.0000000000000002"], // min above 1
+ [2147483647.0, "2147483647"], // max int32
+ [2147483647.0000002, "2147483647.0000002"], // min not int32
+ [2147483648.0, "2147483648"], // min int not int32
+ [4295967295.0, "4295967295"], // max uint32
+ [4295967295.000001, "4295967295.000001"], // min not uint-32
+ [4295967296.0, "4295967296"], // min int not-uint32
+ [1.7976931348623157e+308, "1.7976931348623157e+308"], // Max finit
+ [1.7976931348623157e+308, "1.7976931348623158e+308"], // Max finit
+ [double.INFINITY, "1.7976931348623159e+308"], // Infinity
+ [.049999999999999994, ".049999999999999994"], // not 0.5
+ [.05, ".04999999999999999935"],
+ [4503599627370498.0, "4503599627370497.5"],
+ [1.2345678901234568e+39, "1234567890123456898981341324213421342134"],
+ [9.87291183742987e+24, "9872911837429871193379121"],
+ [1e21, "1e+21"],
];
-
void main() {
for (var test in TESTS) {
runTest(test[0], test[1]);

Powered by Google App Engine
This is Rietveld 408576698