OLD | NEW |
(Empty) | |
| 1 dart_library.library('corelib/double_compare_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__double_compare_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const expect$ = expect.expect; |
| 10 const double_compare_test = Object.create(null); |
| 11 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 12 double_compare_test.main = function() { |
| 13 expect$.Expect.equals(0, 0.0[dartx.compareTo](0.0)); |
| 14 expect$.Expect.equals(0, 1.0[dartx.compareTo](1.0)); |
| 15 expect$.Expect.equals(0, (-2.0)[dartx.compareTo](-2.0)); |
| 16 expect$.Expect.equals(0, (1e-50)[dartx.compareTo](1e-50)); |
| 17 expect$.Expect.equals(0, (-2e+50)[dartx.compareTo](-2e+50)); |
| 18 expect$.Expect.equals(0, core.double.NAN[dartx.compareTo](core.double.NAN)); |
| 19 expect$.Expect.equals(0, core.double.INFINITY[dartx.compareTo](core.double.I
NFINITY)); |
| 20 expect$.Expect.equals(0, core.double.NEGATIVE_INFINITY[dartx.compareTo](core
.double.NEGATIVE_INFINITY)); |
| 21 expect$.Expect.equals(0, (-0.0)[dartx.compareTo](-0.0)); |
| 22 expect$.Expect.isTrue(dart.notNull(0.0[dartx.compareTo](1.0)) < 0); |
| 23 expect$.Expect.isTrue(dart.notNull(1.0[dartx.compareTo](0.0)) > 0); |
| 24 expect$.Expect.isTrue(dart.notNull(0.0[dartx.compareTo](-1.0)) > 0); |
| 25 expect$.Expect.isTrue(dart.notNull((-1.0)[dartx.compareTo](0.0)) < 0); |
| 26 expect$.Expect.isTrue(dart.notNull(0.0[dartx.compareTo](123400000000000.0))
< 0); |
| 27 expect$.Expect.isTrue(dart.notNull(1.23e-110[dartx.compareTo](0.0)) > 0); |
| 28 expect$.Expect.isTrue(dart.notNull(0.0[dartx.compareTo](-123000000000000.0))
> 0); |
| 29 expect$.Expect.isTrue(dart.notNull((-100000000.0)[dartx.compareTo](0.0)) < 0
); |
| 30 let maxDouble = 1.7976931348623157e+308; |
| 31 expect$.Expect.equals(0, maxDouble[dartx.compareTo](maxDouble)); |
| 32 expect$.Expect.isTrue(dart.notNull(maxDouble[dartx.compareTo](core.double.IN
FINITY)) < 0); |
| 33 expect$.Expect.isTrue(dart.notNull(core.double.INFINITY[dartx.compareTo](max
Double)) > 0); |
| 34 let negMaxDouble = -maxDouble; |
| 35 expect$.Expect.equals(0, negMaxDouble[dartx.compareTo](negMaxDouble)); |
| 36 expect$.Expect.isTrue(dart.notNull(core.double.NEGATIVE_INFINITY[dartx.compa
reTo](negMaxDouble)) < 0); |
| 37 expect$.Expect.isTrue(dart.notNull(negMaxDouble[dartx.compareTo](core.double
.NEGATIVE_INFINITY)) > 0); |
| 38 expect$.Expect.isTrue(dart.notNull((-0.0)[dartx.compareTo](0.0)) < 0); |
| 39 expect$.Expect.isTrue(dart.notNull(0.0[dartx.compareTo](-0.0)) > 0); |
| 40 expect$.Expect.isTrue(dart.notNull(core.double.NAN[dartx.compareTo](core.dou
ble.INFINITY)) > 0); |
| 41 expect$.Expect.isTrue(dart.notNull(core.double.NAN[dartx.compareTo](core.dou
ble.NEGATIVE_INFINITY)) > 0); |
| 42 expect$.Expect.isTrue(dart.notNull(core.double.INFINITY[dartx.compareTo](cor
e.double.NAN)) < 0); |
| 43 expect$.Expect.isTrue(dart.notNull(core.double.NEGATIVE_INFINITY[dartx.compa
reTo](core.double.NAN)) < 0); |
| 44 expect$.Expect.isTrue(dart.notNull(maxDouble[dartx.compareTo](core.double.NA
N)) < 0); |
| 45 expect$.Expect.isTrue(dart.notNull(negMaxDouble[dartx.compareTo](core.double
.NAN)) < 0); |
| 46 expect$.Expect.isTrue(dart.notNull(core.double.NAN[dartx.compareTo](maxDoubl
e)) > 0); |
| 47 expect$.Expect.isTrue(dart.notNull(core.double.NAN[dartx.compareTo](negMaxDo
uble)) > 0); |
| 48 }; |
| 49 dart.fn(double_compare_test.main, VoidTovoid()); |
| 50 // Exports: |
| 51 exports.double_compare_test = double_compare_test; |
| 52 }); |
OLD | NEW |