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

Side by Side Diff: test/codegen/expect/language/comparison_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('language/comparison_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__comparison_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 comparison_test = Object.create(null);
11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
12 comparison_test.Helper = class Helper extends core.Object {
13 static STRICT_EQ(a, b) {
14 return core.identical(a, b);
15 }
16 static STRICT_NE(a, b) {
17 return !core.identical(a, b);
18 }
19 static EQ(a, b) {
20 return dart.equals(a, b);
21 }
22 static NE(a, b) {
23 return !dart.equals(a, b);
24 }
25 static LT(a, b) {
26 return core.bool._check(dart.dsend(a, '<', b));
27 }
28 static LE(a, b) {
29 return core.bool._check(dart.dsend(a, '<=', b));
30 }
31 static GT(a, b) {
32 return core.bool._check(dart.dsend(a, '>', b));
33 }
34 static GE(a, b) {
35 return core.bool._check(dart.dsend(a, '>=', b));
36 }
37 };
38 dart.setSignature(comparison_test.Helper, {
39 statics: () => ({
40 STRICT_EQ: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynami c]),
41 STRICT_NE: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynami c]),
42 EQ: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynamic]),
43 NE: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynamic]),
44 LT: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynamic]),
45 LE: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynamic]),
46 GT: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynamic]),
47 GE: dart.definiteFunctionType(core.bool, [dart.dynamic, dart.dynamic])
48 }),
49 names: ['STRICT_EQ', 'STRICT_NE', 'EQ', 'NE', 'LT', 'LE', 'GT', 'GE']
50 });
51 comparison_test.A = class A extends core.Object {
52 new(x) {
53 this.b = x;
54 }
55 };
56 dart.setSignature(comparison_test.A, {
57 constructors: () => ({new: dart.definiteFunctionType(comparison_test.A, [dar t.dynamic])})
58 });
59 comparison_test.ComparisonTest = class ComparisonTest extends core.Object {
60 static testMain() {
61 let a = new comparison_test.A(0);
62 let b = new comparison_test.A(1);
63 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(a, a));
64 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(a, b));
65 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(b, a));
66 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(b, b));
67 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(a, a));
68 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(a, b));
69 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(b, a));
70 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(b, b));
71 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(false, false));
72 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(false, true));
73 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(true, false));
74 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(true, true));
75 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(false, false));
76 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(false, true));
77 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(true, false));
78 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(true, true));
79 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(false, false));
80 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(false, true));
81 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(true, false));
82 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(true, true));
83 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(false, false));
84 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(false, true));
85 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(true, false));
86 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(true, true));
87 expect$.Expect.isTrue(comparison_test.Helper.EQ(false, false));
88 expect$.Expect.isFalse(comparison_test.Helper.EQ(false, true));
89 expect$.Expect.isFalse(comparison_test.Helper.EQ(true, false));
90 expect$.Expect.isTrue(comparison_test.Helper.EQ(true, true));
91 expect$.Expect.isFalse(comparison_test.Helper.NE(false, false));
92 expect$.Expect.isTrue(comparison_test.Helper.NE(false, true));
93 expect$.Expect.isTrue(comparison_test.Helper.NE(true, false));
94 expect$.Expect.isFalse(comparison_test.Helper.NE(true, true));
95 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(-1, -1));
96 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(0, 0));
97 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(1, 1));
98 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(-1, 0));
99 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(-1, 1));
100 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(0, 1));
101 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(-1, -1));
102 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(0, 0));
103 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(1, 1));
104 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(-1, 0));
105 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(-1, 1));
106 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(0, 1));
107 expect$.Expect.isTrue(comparison_test.Helper.EQ(-1, -1));
108 expect$.Expect.isTrue(comparison_test.Helper.EQ(0, 0));
109 expect$.Expect.isTrue(comparison_test.Helper.EQ(1, 1));
110 expect$.Expect.isFalse(comparison_test.Helper.EQ(-1, 0));
111 expect$.Expect.isFalse(comparison_test.Helper.EQ(-1, 1));
112 expect$.Expect.isFalse(comparison_test.Helper.EQ(0, 1));
113 expect$.Expect.isFalse(comparison_test.Helper.NE(-1, -1));
114 expect$.Expect.isFalse(comparison_test.Helper.NE(0, 0));
115 expect$.Expect.isFalse(comparison_test.Helper.NE(1, 1));
116 expect$.Expect.isTrue(comparison_test.Helper.NE(-1, 0));
117 expect$.Expect.isTrue(comparison_test.Helper.NE(-1, 1));
118 expect$.Expect.isTrue(comparison_test.Helper.NE(0, 1));
119 expect$.Expect.isFalse(comparison_test.Helper.LT(-1, -1));
120 expect$.Expect.isFalse(comparison_test.Helper.LT(0, 0));
121 expect$.Expect.isFalse(comparison_test.Helper.LT(1, 1));
122 expect$.Expect.isTrue(comparison_test.Helper.LT(-1, 0));
123 expect$.Expect.isTrue(comparison_test.Helper.LT(-1, 1));
124 expect$.Expect.isTrue(comparison_test.Helper.LT(0, 1));
125 expect$.Expect.isFalse(comparison_test.Helper.LT(0, -1));
126 expect$.Expect.isFalse(comparison_test.Helper.LT(1, -1));
127 expect$.Expect.isFalse(comparison_test.Helper.LT(1, 0));
128 expect$.Expect.isTrue(comparison_test.Helper.LE(-1, -1));
129 expect$.Expect.isTrue(comparison_test.Helper.LE(0, 0));
130 expect$.Expect.isTrue(comparison_test.Helper.LE(1, 1));
131 expect$.Expect.isTrue(comparison_test.Helper.LE(-1, 0));
132 expect$.Expect.isTrue(comparison_test.Helper.LE(-1, 1));
133 expect$.Expect.isTrue(comparison_test.Helper.LE(0, 1));
134 expect$.Expect.isFalse(comparison_test.Helper.LE(0, -1));
135 expect$.Expect.isFalse(comparison_test.Helper.LE(1, -1));
136 expect$.Expect.isFalse(comparison_test.Helper.LE(1, 0));
137 expect$.Expect.isFalse(comparison_test.Helper.GT(-1, -1));
138 expect$.Expect.isFalse(comparison_test.Helper.GT(0, 0));
139 expect$.Expect.isFalse(comparison_test.Helper.GT(1, 1));
140 expect$.Expect.isFalse(comparison_test.Helper.GT(-1, 0));
141 expect$.Expect.isFalse(comparison_test.Helper.GT(-1, 1));
142 expect$.Expect.isFalse(comparison_test.Helper.GT(0, 1));
143 expect$.Expect.isTrue(comparison_test.Helper.GT(0, -1));
144 expect$.Expect.isTrue(comparison_test.Helper.GT(1, -1));
145 expect$.Expect.isTrue(comparison_test.Helper.GT(1, 0));
146 expect$.Expect.isTrue(comparison_test.Helper.GE(-1, -1));
147 expect$.Expect.isTrue(comparison_test.Helper.GE(0, 0));
148 expect$.Expect.isTrue(comparison_test.Helper.GE(1, 1));
149 expect$.Expect.isFalse(comparison_test.Helper.GE(-1, 0));
150 expect$.Expect.isFalse(comparison_test.Helper.GE(-1, 1));
151 expect$.Expect.isFalse(comparison_test.Helper.GE(0, 1));
152 expect$.Expect.isTrue(comparison_test.Helper.GE(0, -1));
153 expect$.Expect.isTrue(comparison_test.Helper.GE(1, -1));
154 expect$.Expect.isTrue(comparison_test.Helper.GE(1, 0));
155 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(-1.0, -1.0));
156 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(0.0, 0.0));
157 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(1.0, 1.0));
158 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(-1.0, 0.0));
159 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(-1.0, 1.0));
160 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(0.0, 1.0));
161 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(-1.0, -1.0));
162 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(0.0, 0.0));
163 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(1.0, 1.0));
164 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(-1.0, 0.0));
165 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(-1.0, 1.0));
166 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(0.0, 1.0));
167 expect$.Expect.isTrue(comparison_test.Helper.EQ(-1.0, -1.0));
168 expect$.Expect.isTrue(comparison_test.Helper.EQ(0.0, 0.0));
169 expect$.Expect.isTrue(comparison_test.Helper.EQ(1.0, 1.0));
170 expect$.Expect.isFalse(comparison_test.Helper.EQ(-1.0, 0.0));
171 expect$.Expect.isFalse(comparison_test.Helper.EQ(-1.0, 1.0));
172 expect$.Expect.isFalse(comparison_test.Helper.EQ(0.0, 1.0));
173 expect$.Expect.isFalse(comparison_test.Helper.NE(-1.0, -1.0));
174 expect$.Expect.isFalse(comparison_test.Helper.NE(0.0, 0.0));
175 expect$.Expect.isFalse(comparison_test.Helper.NE(1.0, 1.0));
176 expect$.Expect.isTrue(comparison_test.Helper.NE(-1.0, 0.0));
177 expect$.Expect.isTrue(comparison_test.Helper.NE(-1.0, 1.0));
178 expect$.Expect.isTrue(comparison_test.Helper.NE(0.0, 1.0));
179 expect$.Expect.isFalse(comparison_test.Helper.LT(-1.0, -1.0));
180 expect$.Expect.isFalse(comparison_test.Helper.LT(0.0, 0.0));
181 expect$.Expect.isFalse(comparison_test.Helper.LT(1.0, 1.0));
182 expect$.Expect.isTrue(comparison_test.Helper.LT(-1.0, 0.0));
183 expect$.Expect.isTrue(comparison_test.Helper.LT(-1.0, 1.0));
184 expect$.Expect.isTrue(comparison_test.Helper.LT(0.0, 1.0));
185 expect$.Expect.isFalse(comparison_test.Helper.LT(0.0, -1.0));
186 expect$.Expect.isFalse(comparison_test.Helper.LT(1.0, -1.0));
187 expect$.Expect.isFalse(comparison_test.Helper.LT(1.0, 0.0));
188 expect$.Expect.isTrue(comparison_test.Helper.LE(-1.0, -1.0));
189 expect$.Expect.isTrue(comparison_test.Helper.LE(0.0, 0.0));
190 expect$.Expect.isTrue(comparison_test.Helper.LE(1.0, 1.0));
191 expect$.Expect.isTrue(comparison_test.Helper.LE(-1.0, 0.0));
192 expect$.Expect.isTrue(comparison_test.Helper.LE(-1.0, 1.0));
193 expect$.Expect.isTrue(comparison_test.Helper.LE(0.0, 1.0));
194 expect$.Expect.isFalse(comparison_test.Helper.LE(0.0, -1.0));
195 expect$.Expect.isFalse(comparison_test.Helper.LE(1.0, -1.0));
196 expect$.Expect.isFalse(comparison_test.Helper.LE(1.0, 0.0));
197 expect$.Expect.isFalse(comparison_test.Helper.GT(-1.0, -1.0));
198 expect$.Expect.isFalse(comparison_test.Helper.GT(0.0, 0.0));
199 expect$.Expect.isFalse(comparison_test.Helper.GT(1.0, 1.0));
200 expect$.Expect.isFalse(comparison_test.Helper.GT(-1.0, 0.0));
201 expect$.Expect.isFalse(comparison_test.Helper.GT(-1.0, 1.0));
202 expect$.Expect.isFalse(comparison_test.Helper.GT(0.0, 1.0));
203 expect$.Expect.isTrue(comparison_test.Helper.GT(0.0, -1.0));
204 expect$.Expect.isTrue(comparison_test.Helper.GT(1.0, -1.0));
205 expect$.Expect.isTrue(comparison_test.Helper.GT(1.0, 0.0));
206 expect$.Expect.isTrue(comparison_test.Helper.GE(-1.0, -1.0));
207 expect$.Expect.isTrue(comparison_test.Helper.GE(0.0, 0.0));
208 expect$.Expect.isTrue(comparison_test.Helper.GE(1.0, 1.0));
209 expect$.Expect.isFalse(comparison_test.Helper.GE(-1.0, 0.0));
210 expect$.Expect.isFalse(comparison_test.Helper.GE(-1.0, 1.0));
211 expect$.Expect.isFalse(comparison_test.Helper.GE(0.0, 1.0));
212 expect$.Expect.isTrue(comparison_test.Helper.GE(0.0, -1.0));
213 expect$.Expect.isTrue(comparison_test.Helper.GE(1.0, -1.0));
214 expect$.Expect.isTrue(comparison_test.Helper.GE(1.0, 0.0));
215 expect$.Expect.isTrue(comparison_test.Helper.EQ(null, null));
216 expect$.Expect.isFalse(comparison_test.Helper.EQ(null, "Str"));
217 expect$.Expect.isTrue(comparison_test.Helper.NE(null, 2));
218 expect$.Expect.isFalse(comparison_test.Helper.NE(null, null));
219 expect$.Expect.isTrue(comparison_test.Helper.STRICT_EQ(null, null));
220 expect$.Expect.isFalse(comparison_test.Helper.STRICT_EQ(null, "Str"));
221 expect$.Expect.isTrue(comparison_test.Helper.STRICT_NE(null, 2));
222 expect$.Expect.isFalse(comparison_test.Helper.STRICT_NE(null, null));
223 expect$.Expect.isFalse(comparison_test.Helper.GT(1, 1.2));
224 expect$.Expect.isTrue(comparison_test.Helper.GT(3, 1.2));
225 expect$.Expect.isTrue(comparison_test.Helper.GT(2.0, 1));
226 expect$.Expect.isFalse(comparison_test.Helper.GT(3.1, 4));
227 expect$.Expect.isFalse(comparison_test.Helper.GE(1, 1.2));
228 expect$.Expect.isTrue(comparison_test.Helper.GE(3, 1.2));
229 expect$.Expect.isTrue(comparison_test.Helper.GE(2.0, 1));
230 expect$.Expect.isFalse(comparison_test.Helper.GE(3.1, 4));
231 expect$.Expect.isTrue(comparison_test.Helper.GE(2.0, 2));
232 expect$.Expect.isTrue(comparison_test.Helper.GE(2, 2.0));
233 expect$.Expect.isTrue(comparison_test.Helper.LT(1, 1.2));
234 expect$.Expect.isFalse(comparison_test.Helper.LT(3, 1.2));
235 expect$.Expect.isFalse(comparison_test.Helper.LT(2.0, 1));
236 expect$.Expect.isTrue(comparison_test.Helper.LT(3.1, 4));
237 expect$.Expect.isTrue(comparison_test.Helper.LE(1, 1.2));
238 expect$.Expect.isFalse(comparison_test.Helper.LE(3, 1.2));
239 expect$.Expect.isFalse(comparison_test.Helper.LE(2.0, 1));
240 expect$.Expect.isTrue(comparison_test.Helper.LE(3.1, 4));
241 expect$.Expect.isTrue(comparison_test.Helper.LE(2.0, 2));
242 expect$.Expect.isTrue(comparison_test.Helper.LE(2, 2.0));
243 expect$.Expect.isTrue(comparison_test.Helper.LE(263882790666245, 263882790 666246));
244 expect$.Expect.isTrue(comparison_test.Helper.LE(263882790666245, 263882790 666245));
245 expect$.Expect.isFalse(comparison_test.Helper.LE(263882790666246, 26388279 0666245));
246 expect$.Expect.isTrue(comparison_test.Helper.LE(12, 263882790666245));
247 expect$.Expect.isTrue(comparison_test.Helper.LE(12.2, 263882790666245));
248 expect$.Expect.isTrue(comparison_test.Helper.EQ(4294967295, 4294967295.0)) ;
249 expect$.Expect.isTrue(comparison_test.Helper.EQ(4294967295.0, 4294967295)) ;
250 expect$.Expect.isFalse(comparison_test.Helper.EQ(4294967295.0, 42));
251 expect$.Expect.isFalse(comparison_test.Helper.EQ(42, 4294967295.0));
252 expect$.Expect.isFalse(comparison_test.Helper.EQ(4294967295, 42));
253 expect$.Expect.isFalse(comparison_test.Helper.EQ(42, 4294967295));
254 expect$.Expect.isTrue(comparison_test.Helper.EQ(1.0, 1));
255 expect$.Expect.isTrue(comparison_test.Helper.EQ(1.0, 1));
256 expect$.Expect.isTrue(comparison_test.Helper.EQ(1, 1.0));
257 expect$.Expect.isTrue(comparison_test.Helper.EQ(1, 1.0));
258 expect$.Expect.isTrue(comparison_test.Helper.EQ(1.1, 1.1));
259 expect$.Expect.isTrue(comparison_test.Helper.EQ(1.1, 1.1));
260 expect$.Expect.isTrue(comparison_test.Helper.EQ(1.1, 1.1));
261 expect$.Expect.isFalse(comparison_test.Helper.GT(1, 1.2));
262 expect$.Expect.isTrue(comparison_test.Helper.GT(1.2, 1));
263 expect$.Expect.isTrue(comparison_test.Helper.GT(1.2, 1.1));
264 expect$.Expect.isTrue(comparison_test.Helper.GT(1.2, 1.1));
265 expect$.Expect.isTrue(comparison_test.Helper.GT(1.2, 1.1));
266 expect$.Expect.isTrue(comparison_test.Helper.LT(1, 1.2));
267 expect$.Expect.isFalse(comparison_test.Helper.LT(1.2, 1));
268 expect$.Expect.isFalse(comparison_test.Helper.LT(1.2, 1.1));
269 expect$.Expect.isFalse(comparison_test.Helper.LT(1.2, 1.1));
270 expect$.Expect.isFalse(comparison_test.Helper.LT(1.2, 1.1));
271 expect$.Expect.isFalse(comparison_test.Helper.GE(1.1, 1.2));
272 expect$.Expect.isFalse(comparison_test.Helper.GE(1.1, 1.2));
273 expect$.Expect.isTrue(comparison_test.Helper.GE(1.2, 1.2));
274 expect$.Expect.isTrue(comparison_test.Helper.GE(1.2, 1.2));
275 expect$.Expect.isFalse(comparison_test.Helper.EQ(1, "eeny"));
276 expect$.Expect.isFalse(comparison_test.Helper.EQ("meeny", 1));
277 expect$.Expect.isFalse(comparison_test.Helper.EQ(1.1, "miny"));
278 expect$.Expect.isFalse(comparison_test.Helper.EQ("moe", 1.1));
279 expect$.Expect.isFalse(comparison_test.Helper.EQ(1.1, "catch"));
280 expect$.Expect.isFalse(comparison_test.Helper.EQ("the", 1.1));
281 expect$.Expect.isFalse(comparison_test.Helper.EQ(1, null));
282 expect$.Expect.isFalse(comparison_test.Helper.EQ(null, 1));
283 expect$.Expect.isFalse(comparison_test.Helper.EQ(1.1, null));
284 expect$.Expect.isFalse(comparison_test.Helper.EQ(null, 1.1));
285 expect$.Expect.isFalse(comparison_test.Helper.EQ(1.1, null));
286 expect$.Expect.isFalse(comparison_test.Helper.EQ(null, 1.1));
287 }
288 };
289 dart.setSignature(comparison_test.ComparisonTest, {
290 statics: () => ({testMain: dart.definiteFunctionType(dart.dynamic, [])}),
291 names: ['testMain']
292 });
293 comparison_test.main = function() {
294 comparison_test.ComparisonTest.testMain();
295 };
296 dart.fn(comparison_test.main, VoidTodynamic());
297 // Exports:
298 exports.comparison_test = comparison_test;
299 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698