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

Side by Side Diff: test/codegen/expect/corelib/double_truncate_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
(Empty)
1 dart_library.library('corelib/double_truncate_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__double_truncate_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_truncate_test = Object.create(null);
11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
12 double_truncate_test.main = function() {
13 expect$.Expect.equals(0, 0.0[dartx.truncate]());
14 expect$.Expect.equals(0, core.double.MIN_POSITIVE[dartx.truncate]());
15 expect$.Expect.equals(0, (2.0 * dart.notNull(core.double.MIN_POSITIVE))[dart x.truncate]());
16 expect$.Expect.equals(0, 1.18e-38[dartx.truncate]());
17 expect$.Expect.equals(0, (1.18e-38 * 2)[dartx.truncate]());
18 expect$.Expect.equals(0, 0.49999999999999994[dartx.truncate]());
19 expect$.Expect.equals(0, 0.5[dartx.truncate]());
20 expect$.Expect.equals(0, 0.9999999999999999[dartx.truncate]());
21 expect$.Expect.equals(1, 1.0[dartx.truncate]());
22 expect$.Expect.equals(1, 1.000000000000001[dartx.truncate]());
23 expect$.Expect.equals(4503599627370496, 4503599627370496.0[dartx.truncate]() );
24 expect$.Expect.equals(4503599627370497, 4503599627370497.0[dartx.truncate]() );
25 expect$.Expect.equals(4503599627370498, 4503599627370498.0[dartx.truncate]() );
26 expect$.Expect.equals(4503599627370499, 4503599627370499.0[dartx.truncate]() );
27 expect$.Expect.equals(9007199254740991, 9007199254740991.0[dartx.truncate]() );
28 expect$.Expect.equals(9007199254740992, 9007199254740992.0[dartx.truncate]() );
29 expect$.Expect.equals(179769313486231570814527423731704356798070567525844996 59891747680315726078002853876058955863276687817154045895351438246423432132688946 41827684675467035375169860499105765512820762454900903893289440758685084551339423 04583236903222948165808559332123348274797826204144723168738177180919299881250404 026184124858368, core.double.MAX_FINITE[dartx.truncate]());
30 expect$.Expect.equals(0, (-dart.notNull(core.double.MIN_POSITIVE))[dartx.tru ncate]());
31 expect$.Expect.equals(0, (2.0 * -dart.notNull(core.double.MIN_POSITIVE))[dar tx.truncate]());
32 expect$.Expect.equals(0, (-1.18e-38)[dartx.truncate]());
33 expect$.Expect.equals(0, (-1.18e-38 * 2)[dartx.truncate]());
34 expect$.Expect.equals(0, (-0.49999999999999994)[dartx.truncate]());
35 expect$.Expect.equals(0, (-0.5)[dartx.truncate]());
36 expect$.Expect.equals(0, (-0.9999999999999999)[dartx.truncate]());
37 expect$.Expect.equals(-1, (-1.0)[dartx.truncate]());
38 expect$.Expect.equals(-1, (-1.000000000000001)[dartx.truncate]());
39 expect$.Expect.equals(-4503599627370496, (-4503599627370496.0)[dartx.truncat e]());
40 expect$.Expect.equals(-4503599627370497, (-4503599627370497.0)[dartx.truncat e]());
41 expect$.Expect.equals(-4503599627370498, (-4503599627370498.0)[dartx.truncat e]());
42 expect$.Expect.equals(-4503599627370499, (-4503599627370499.0)[dartx.truncat e]());
43 expect$.Expect.equals(-9007199254740991, (-9007199254740991.0)[dartx.truncat e]());
44 expect$.Expect.equals(-9007199254740992, (-9007199254740992.0)[dartx.truncat e]());
45 expect$.Expect.equals(-17976931348623157081452742373170435679807056752584499 65989174768031572607800285387605895586327668781715404589535143824642343213268894 64182768467546703537516986049910576551282076245490090389328944075868508455133942 30458323690322294816580855933212334827479782620414472316873817718091929988125040 4026184124858368, (-dart.notNull(core.double.MAX_FINITE))[dartx.truncate]());
46 expect$.Expect.isTrue(typeof 0.0[dartx.truncate]() == 'number');
47 expect$.Expect.isTrue(typeof core.double.MIN_POSITIVE[dartx.truncate]() == ' number');
48 expect$.Expect.isTrue(typeof (2.0 * dart.notNull(core.double.MIN_POSITIVE))[ dartx.truncate]() == 'number');
49 expect$.Expect.isTrue(typeof 1.18e-38[dartx.truncate]() == 'number');
50 expect$.Expect.isTrue(typeof (1.18e-38 * 2)[dartx.truncate]() == 'number');
51 expect$.Expect.isTrue(typeof 0.49999999999999994[dartx.truncate]() == 'numbe r');
52 expect$.Expect.isTrue(typeof 0.5[dartx.truncate]() == 'number');
53 expect$.Expect.isTrue(typeof 0.9999999999999999[dartx.truncate]() == 'number ');
54 expect$.Expect.isTrue(typeof 1.0[dartx.truncate]() == 'number');
55 expect$.Expect.isTrue(typeof 1.000000000000001[dartx.truncate]() == 'number' );
56 expect$.Expect.isTrue(typeof 4503599627370496.0[dartx.truncate]() == 'number ');
57 expect$.Expect.isTrue(typeof 4503599627370497.0[dartx.truncate]() == 'number ');
58 expect$.Expect.isTrue(typeof 4503599627370498.0[dartx.truncate]() == 'number ');
59 expect$.Expect.isTrue(typeof 4503599627370499.0[dartx.truncate]() == 'number ');
60 expect$.Expect.isTrue(typeof 9007199254740991.0[dartx.truncate]() == 'number ');
61 expect$.Expect.isTrue(typeof 9007199254740992.0[dartx.truncate]() == 'number ');
62 expect$.Expect.isTrue(typeof core.double.MAX_FINITE[dartx.truncate]() == 'nu mber');
63 expect$.Expect.isTrue((-dart.notNull(core.double.MIN_POSITIVE))[dartx.trunca teToDouble]()[dartx.isNegative]);
64 expect$.Expect.isTrue((2.0 * -dart.notNull(core.double.MIN_POSITIVE))[dartx. truncateToDouble]()[dartx.isNegative]);
65 expect$.Expect.isTrue((-1.18e-38)[dartx.truncateToDouble]()[dartx.isNegative ]);
66 expect$.Expect.isTrue((-1.18e-38 * 2)[dartx.truncateToDouble]()[dartx.isNega tive]);
67 expect$.Expect.isTrue((-0.49999999999999994)[dartx.truncateToDouble]()[dartx .isNegative]);
68 expect$.Expect.isTrue((-0.5)[dartx.truncateToDouble]()[dartx.isNegative]);
69 expect$.Expect.isTrue((-0.9999999999999999)[dartx.truncateToDouble]()[dartx. isNegative]);
70 expect$.Expect.isTrue(typeof (-dart.notNull(core.double.MIN_POSITIVE))[dartx .truncate]() == 'number');
71 expect$.Expect.isTrue(typeof (2.0 * -dart.notNull(core.double.MIN_POSITIVE)) [dartx.truncate]() == 'number');
72 expect$.Expect.isTrue(typeof (-1.18e-38)[dartx.truncate]() == 'number');
73 expect$.Expect.isTrue(typeof (-1.18e-38 * 2)[dartx.truncate]() == 'number');
74 expect$.Expect.isTrue(typeof (-0.49999999999999994)[dartx.truncate]() == 'nu mber');
75 expect$.Expect.isTrue(typeof (-0.5)[dartx.truncate]() == 'number');
76 expect$.Expect.isTrue(typeof (-0.9999999999999999)[dartx.truncate]() == 'num ber');
77 expect$.Expect.isTrue(typeof (-1.0)[dartx.truncate]() == 'number');
78 expect$.Expect.isTrue(typeof (-1.000000000000001)[dartx.truncate]() == 'numb er');
79 expect$.Expect.isTrue(typeof (-4503599627370496.0)[dartx.truncate]() == 'num ber');
80 expect$.Expect.isTrue(typeof (-4503599627370497.0)[dartx.truncate]() == 'num ber');
81 expect$.Expect.isTrue(typeof (-4503599627370498.0)[dartx.truncate]() == 'num ber');
82 expect$.Expect.isTrue(typeof (-4503599627370499.0)[dartx.truncate]() == 'num ber');
83 expect$.Expect.isTrue(typeof (-9007199254740991.0)[dartx.truncate]() == 'num ber');
84 expect$.Expect.isTrue(typeof (-9007199254740992.0)[dartx.truncate]() == 'num ber');
85 expect$.Expect.isTrue(typeof (-dart.notNull(core.double.MAX_FINITE))[dartx.t runcate]() == 'number');
86 };
87 dart.fn(double_truncate_test.main, VoidTodynamic());
88 // Exports:
89 exports.double_truncate_test = double_truncate_test;
90 });
OLDNEW
« no previous file with comments | « test/codegen/expect/corelib/double_truncate2_test.js ('k') | test/codegen/expect/corelib/double_truncate_to_double_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698