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

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

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « test/codegen/expect/es6_modules.txt ('k') | test/codegen/expect/expect.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 dart_library.library('expect', null, /* Imports */[ 1 dart_library.library('expect', null, /* Imports */[
2 'dart/_runtime', 2 'dart_sdk'
3 'dart/core' 3 ], function(exports, dart_sdk) {
4 ], /* Lazy imports */[
5 ], function(exports, dart, core) {
6 'use strict'; 4 'use strict';
7 let dartx = dart.dartx; 5 const core = dart_sdk.core;
8 class Expect extends core.Object { 6 const dart = dart_sdk.dart;
7 const dartx = dart_sdk.dartx;
8 const expect = Object.create(null);
9 expect.Expect = class Expect extends core.Object {
9 static _truncateString(string, start, end, length) { 10 static _truncateString(string, start, end, length) {
10 if (dart.notNull(end) - dart.notNull(start) > dart.notNull(length)) { 11 if (dart.notNull(end) - dart.notNull(start) > dart.notNull(length)) {
11 end = dart.notNull(start) + dart.notNull(length); 12 end = dart.notNull(start) + dart.notNull(length);
12 } else if (dart.notNull(end) - dart.notNull(start) < dart.notNull(length)) { 13 } else if (dart.notNull(end) - dart.notNull(start) < dart.notNull(length)) {
13 let overflow = dart.notNull(length) - (dart.notNull(end) - dart.notNull( start)); 14 let overflow = dart.notNull(length) - (dart.notNull(end) - dart.notNull( start));
14 if (overflow > 10) overflow = 10; 15 if (overflow > 10) overflow = 10;
15 start = dart.notNull(start) - ((overflow + 1) / 2)[dartx.truncate](); 16 start = dart.notNull(start) - ((overflow + 1) / 2)[dartx.truncate]();
16 end = dart.notNull(end) + (overflow / 2)[dartx.truncate](); 17 end = dart.notNull(end) + (overflow / 2)[dartx.truncate]();
17 if (dart.notNull(start) < 0) start = 0; 18 if (dart.notNull(start) < 0) start = 0;
18 if (dart.notNull(end) > dart.notNull(string[dartx.length])) end = string [dartx.length]; 19 if (dart.notNull(end) > dart.notNull(string[dartx.length])) end = string [dartx.length];
(...skipping 18 matching lines...) Expand all
37 if (dart.notNull(expected[dartx.length]) < 20 && dart.notNull(actual[dartx .length]) < 20) return null; 38 if (dart.notNull(expected[dartx.length]) < 20 && dart.notNull(actual[dartx .length]) < 20) return null;
38 for (let i = 0; i < dart.notNull(expected[dartx.length]) && i < dart.notNu ll(actual[dartx.length]); i++) { 39 for (let i = 0; i < dart.notNull(expected[dartx.length]) && i < dart.notNu ll(actual[dartx.length]); i++) {
39 if (expected[dartx.codeUnitAt](i) != actual[dartx.codeUnitAt](i)) { 40 if (expected[dartx.codeUnitAt](i) != actual[dartx.codeUnitAt](i)) {
40 let start = i; 41 let start = i;
41 i++; 42 i++;
42 while (i < dart.notNull(expected[dartx.length]) && i < dart.notNull(ac tual[dartx.length])) { 43 while (i < dart.notNull(expected[dartx.length]) && i < dart.notNull(ac tual[dartx.length])) {
43 if (expected[dartx.codeUnitAt](i) == actual[dartx.codeUnitAt](i)) br eak; 44 if (expected[dartx.codeUnitAt](i) == actual[dartx.codeUnitAt](i)) br eak;
44 i++; 45 i++;
45 } 46 }
46 let end = i; 47 let end = i;
47 let truncExpected = Expect._truncateString(expected, start, end, 20); 48 let truncExpected = expect.Expect._truncateString(expected, start, end , 20);
48 let truncActual = Expect._truncateString(actual, start, end, 20); 49 let truncActual = expect.Expect._truncateString(actual, start, end, 20 );
49 return `at index ${start}: Expected <${truncExpected}>, ` + `Found: <$ {truncActual}>`; 50 return `at index ${start}: Expected <${truncExpected}>, ` + `Found: <$ {truncActual}>`;
50 } 51 }
51 } 52 }
52 return null; 53 return null;
53 } 54 }
54 static equals(expected, actual, reason) { 55 static equals(expected, actual, reason) {
55 if (reason === void 0) reason = null; 56 if (reason === void 0) reason = null;
56 if (dart.equals(expected, actual)) return; 57 if (dart.equals(expected, actual)) return;
57 let msg = Expect._getMessage(reason); 58 let msg = expect.Expect._getMessage(reason);
58 if (typeof expected == 'string' && typeof actual == 'string') { 59 if (typeof expected == 'string' && typeof actual == 'string') {
59 let stringDifference = Expect._stringDifference(expected, actual); 60 let stringDifference = expect.Expect._stringDifference(expected, actual) ;
60 if (stringDifference != null) { 61 if (stringDifference != null) {
61 Expect._fail(`Expect.equals(${stringDifference}${msg}) fails.`); 62 expect.Expect._fail(`Expect.equals(${stringDifference}${msg}) fails.`) ;
62 } 63 }
63 } 64 }
64 Expect._fail(`Expect.equals(expected: <${expected}>, actual: <${actual}>${ msg}) fails.`); 65 expect.Expect._fail(`Expect.equals(expected: <${expected}>, actual: <${act ual}>${msg}) fails.`);
65 } 66 }
66 static isTrue(actual, reason) { 67 static isTrue(actual, reason) {
67 if (reason === void 0) reason = null; 68 if (reason === void 0) reason = null;
68 if (dart.notNull(_identical(actual, true))) return; 69 if (dart.notNull(expect._identical(actual, true))) return;
69 let msg = Expect._getMessage(reason); 70 let msg = expect.Expect._getMessage(reason);
70 Expect._fail(`Expect.isTrue(${actual}${msg}) fails.`); 71 expect.Expect._fail(`Expect.isTrue(${actual}${msg}) fails.`);
71 } 72 }
72 static isFalse(actual, reason) { 73 static isFalse(actual, reason) {
73 if (reason === void 0) reason = null; 74 if (reason === void 0) reason = null;
74 if (dart.notNull(_identical(actual, false))) return; 75 if (dart.notNull(expect._identical(actual, false))) return;
75 let msg = Expect._getMessage(reason); 76 let msg = expect.Expect._getMessage(reason);
76 Expect._fail(`Expect.isFalse(${actual}${msg}) fails.`); 77 expect.Expect._fail(`Expect.isFalse(${actual}${msg}) fails.`);
77 } 78 }
78 static isNull(actual, reason) { 79 static isNull(actual, reason) {
79 if (reason === void 0) reason = null; 80 if (reason === void 0) reason = null;
80 if (null == actual) return; 81 if (null == actual) return;
81 let msg = Expect._getMessage(reason); 82 let msg = expect.Expect._getMessage(reason);
82 Expect._fail(`Expect.isNull(actual: <${actual}>${msg}) fails.`); 83 expect.Expect._fail(`Expect.isNull(actual: <${actual}>${msg}) fails.`);
83 } 84 }
84 static isNotNull(actual, reason) { 85 static isNotNull(actual, reason) {
85 if (reason === void 0) reason = null; 86 if (reason === void 0) reason = null;
86 if (null != actual) return; 87 if (null != actual) return;
87 let msg = Expect._getMessage(reason); 88 let msg = expect.Expect._getMessage(reason);
88 Expect._fail(`Expect.isNotNull(actual: <${actual}>${msg}) fails.`); 89 expect.Expect._fail(`Expect.isNotNull(actual: <${actual}>${msg}) fails.`);
89 } 90 }
90 static identical(expected, actual, reason) { 91 static identical(expected, actual, reason) {
91 if (reason === void 0) reason = null; 92 if (reason === void 0) reason = null;
92 if (dart.notNull(_identical(expected, actual))) return; 93 if (dart.notNull(expect._identical(expected, actual))) return;
93 let msg = Expect._getMessage(reason); 94 let msg = expect.Expect._getMessage(reason);
94 Expect._fail(`Expect.identical(expected: <${expected}>, actual: <${actual} >${msg}) ` + "fails."); 95 expect.Expect._fail(`Expect.identical(expected: <${expected}>, actual: <${ actual}>${msg}) ` + "fails.");
95 } 96 }
96 static fail(msg) { 97 static fail(msg) {
97 Expect._fail(`Expect.fail('${msg}')`); 98 expect.Expect._fail(`Expect.fail('${msg}')`);
98 } 99 }
99 static approxEquals(expected, actual, tolerance, reason) { 100 static approxEquals(expected, actual, tolerance, reason) {
100 if (tolerance === void 0) tolerance = null; 101 if (tolerance === void 0) tolerance = null;
101 if (reason === void 0) reason = null; 102 if (reason === void 0) reason = null;
102 if (tolerance == null) { 103 if (tolerance == null) {
103 tolerance = (dart.notNull(expected) / 10000.0)[dartx.abs](); 104 tolerance = (dart.notNull(expected) / 10000.0)[dartx.abs]();
104 } 105 }
105 if (dart.notNull((dart.notNull(expected) - dart.notNull(actual))[dartx.abs ]()) <= dart.notNull(tolerance)) return; 106 if (dart.notNull((dart.notNull(expected) - dart.notNull(actual))[dartx.abs ]()) <= dart.notNull(tolerance)) return;
106 let msg = Expect._getMessage(reason); 107 let msg = expect.Expect._getMessage(reason);
107 Expect._fail(`Expect.approxEquals(expected:<${expected}>, actual:<${actual }>, ` + `tolerance:<${tolerance}>${msg}) fails`); 108 expect.Expect._fail(`Expect.approxEquals(expected:<${expected}>, actual:<$ {actual}>, ` + `tolerance:<${tolerance}>${msg}) fails`);
108 } 109 }
109 static notEquals(unexpected, actual, reason) { 110 static notEquals(unexpected, actual, reason) {
110 if (reason === void 0) reason = null; 111 if (reason === void 0) reason = null;
111 if (!dart.equals(unexpected, actual)) return; 112 if (!dart.equals(unexpected, actual)) return;
112 let msg = Expect._getMessage(reason); 113 let msg = expect.Expect._getMessage(reason);
113 Expect._fail(`Expect.notEquals(unexpected: <${unexpected}>, actual:<${actu al}>${msg}) ` + "fails."); 114 expect.Expect._fail(`Expect.notEquals(unexpected: <${unexpected}>, actual: <${actual}>${msg}) ` + "fails.");
114 } 115 }
115 static listEquals(expected, actual, reason) { 116 static listEquals(expected, actual, reason) {
116 if (reason === void 0) reason = null; 117 if (reason === void 0) reason = null;
117 let msg = Expect._getMessage(reason); 118 let msg = expect.Expect._getMessage(reason);
118 let n = dart.notNull(expected[dartx.length]) < dart.notNull(actual[dartx.l ength]) ? expected[dartx.length] : actual[dartx.length]; 119 let n = dart.notNull(expected[dartx.length]) < dart.notNull(actual[dartx.l ength]) ? expected[dartx.length] : actual[dartx.length];
119 for (let i = 0; i < dart.notNull(n); i++) { 120 for (let i = 0; i < dart.notNull(n); i++) {
120 if (!dart.equals(expected[dartx.get](i), actual[dartx.get](i))) { 121 if (!dart.equals(expected[dartx.get](i), actual[dartx.get](i))) {
121 Expect._fail(`Expect.listEquals(at index ${i}, ` + `expected: <${expec ted[dartx.get](i)}>, actual: <${actual[dartx.get](i)}>${msg}) fails`); 122 expect.Expect._fail(`Expect.listEquals(at index ${i}, ` + `expected: < ${expected[dartx.get](i)}>, actual: <${actual[dartx.get](i)}>${msg}) fails`);
122 } 123 }
123 } 124 }
124 if (expected[dartx.length] != actual[dartx.length]) { 125 if (expected[dartx.length] != actual[dartx.length]) {
125 Expect._fail('Expect.listEquals(list length, ' + `expected: <${expected[ dartx.length]}>, actual: <${actual[dartx.length]}>${msg}) ` + 'fails: Next eleme nt <' + `${dart.notNull(expected[dartx.length]) > dart.notNull(n) ? expected[dar tx.get](n) : actual[dartx.get](n)}>`); 126 expect.Expect._fail('Expect.listEquals(list length, ' + `expected: <${ex pected[dartx.length]}>, actual: <${actual[dartx.length]}>${msg}) ` + 'fails: Nex t element <' + `${dart.notNull(expected[dartx.length]) > dart.notNull(n) ? expec ted[dartx.get](n) : actual[dartx.get](n)}>`);
126 } 127 }
127 } 128 }
128 static mapEquals(expected, actual, reason) { 129 static mapEquals(expected, actual, reason) {
129 if (reason === void 0) reason = null; 130 if (reason === void 0) reason = null;
130 let msg = Expect._getMessage(reason); 131 let msg = expect.Expect._getMessage(reason);
131 for (let key of expected[dartx.keys]) { 132 for (let key of expected[dartx.keys]) {
132 if (!dart.notNull(actual[dartx.containsKey](key))) { 133 if (!dart.notNull(actual[dartx.containsKey](key))) {
133 Expect._fail(`Expect.mapEquals(missing expected key: <${key}>${msg}) f ails`); 134 expect.Expect._fail(`Expect.mapEquals(missing expected key: <${key}>${ msg}) fails`);
134 } 135 }
135 Expect.equals(expected[dartx.get](key), actual[dartx.get](key)); 136 expect.Expect.equals(expected[dartx.get](key), actual[dartx.get](key));
136 } 137 }
137 for (let key of actual[dartx.keys]) { 138 for (let key of actual[dartx.keys]) {
138 if (!dart.notNull(expected[dartx.containsKey](key))) { 139 if (!dart.notNull(expected[dartx.containsKey](key))) {
139 Expect._fail(`Expect.mapEquals(unexpected key: <${key}>${msg}) fails`) ; 140 expect.Expect._fail(`Expect.mapEquals(unexpected key: <${key}>${msg}) fails`);
140 } 141 }
141 } 142 }
142 } 143 }
143 static stringEquals(expected, actual, reason) { 144 static stringEquals(expected, actual, reason) {
144 if (reason === void 0) reason = null; 145 if (reason === void 0) reason = null;
145 if (expected == actual) return; 146 if (expected == actual) return;
146 let msg = Expect._getMessage(reason); 147 let msg = expect.Expect._getMessage(reason);
147 let defaultMessage = `Expect.stringEquals(expected: <${expected}>", <${act ual}>${msg}) fails`; 148 let defaultMessage = `Expect.stringEquals(expected: <${expected}>", <${act ual}>${msg}) fails`;
148 if (expected == null || actual == null) { 149 if (expected == null || actual == null) {
149 Expect._fail(`${defaultMessage}`); 150 expect.Expect._fail(`${defaultMessage}`);
150 } 151 }
151 let left = 0; 152 let left = 0;
152 let right = 0; 153 let right = 0;
153 let eLen = expected[dartx.length]; 154 let eLen = expected[dartx.length];
154 let aLen = actual[dartx.length]; 155 let aLen = actual[dartx.length];
155 while (true) { 156 while (true) {
156 if (left == eLen || left == aLen || expected[dartx.get](left) != actual[ dartx.get](left)) { 157 if (left == eLen || left == aLen || expected[dartx.get](left) != actual[ dartx.get](left)) {
157 break; 158 break;
158 } 159 }
159 left++; 160 left++;
(...skipping 15 matching lines...) Expand all
175 eSnippet = dart.notNull(eSnippet[dartx.substring](0, 20)) + "..." + dart .notNull(eSnippet[dartx.substring](dart.notNull(eSnippet[dartx.length]) - 20)); 176 eSnippet = dart.notNull(eSnippet[dartx.substring](0, 20)) + "..." + dart .notNull(eSnippet[dartx.substring](dart.notNull(eSnippet[dartx.length]) - 20));
176 } 177 }
177 if (dart.notNull(aSnippet[dartx.length]) > 43) { 178 if (dart.notNull(aSnippet[dartx.length]) > 43) {
178 aSnippet = dart.notNull(aSnippet[dartx.substring](0, 20)) + "..." + dart .notNull(aSnippet[dartx.substring](dart.notNull(aSnippet[dartx.length]) - 20)); 179 aSnippet = dart.notNull(aSnippet[dartx.substring](0, 20)) + "..." + dart .notNull(aSnippet[dartx.substring](dart.notNull(aSnippet[dartx.length]) - 20));
179 } 180 }
180 let leftLead = "..."; 181 let leftLead = "...";
181 let rightTail = "..."; 182 let rightTail = "...";
182 if (left <= 10) leftLead = ""; 183 if (left <= 10) leftLead = "";
183 if (right <= 10) rightTail = ""; 184 if (right <= 10) rightTail = "";
184 let diff = `\nDiff (${left}..${dart.notNull(eLen) - right}/${dart.notNull( aLen) - right}):\n` + `${leftLead}${leftSnippet}[ ${eSnippet} ]${rightSnippet}${ rightTail}\n` + `${leftLead}${leftSnippet}[ ${aSnippet} ]${rightSnippet}${rightT ail}`; 185 let diff = `\nDiff (${left}..${dart.notNull(eLen) - right}/${dart.notNull( aLen) - right}):\n` + `${leftLead}${leftSnippet}[ ${eSnippet} ]${rightSnippet}${ rightTail}\n` + `${leftLead}${leftSnippet}[ ${aSnippet} ]${rightSnippet}${rightT ail}`;
185 Expect._fail(`${defaultMessage}${diff}`); 186 expect.Expect._fail(`${defaultMessage}${diff}`);
186 } 187 }
187 static setEquals(expected, actual, reason) { 188 static setEquals(expected, actual, reason) {
188 if (reason === void 0) reason = null; 189 if (reason === void 0) reason = null;
189 let missingSet = core.Set.from(expected); 190 let missingSet = core.Set.from(expected);
190 missingSet.removeAll(actual); 191 missingSet.removeAll(actual);
191 let extraSet = core.Set.from(actual); 192 let extraSet = core.Set.from(actual);
192 extraSet.removeAll(expected); 193 extraSet.removeAll(expected);
193 if (dart.notNull(extraSet.isEmpty) && dart.notNull(missingSet.isEmpty)) re turn; 194 if (dart.notNull(extraSet.isEmpty) && dart.notNull(missingSet.isEmpty)) re turn;
194 let msg = Expect._getMessage(reason); 195 let msg = expect.Expect._getMessage(reason);
195 let sb = new core.StringBuffer(`Expect.setEquals(${msg}) fails`); 196 let sb = new core.StringBuffer(`Expect.setEquals(${msg}) fails`);
196 if (!dart.notNull(missingSet.isEmpty)) { 197 if (!dart.notNull(missingSet.isEmpty)) {
197 sb.write('\nExpected collection does not contain: '); 198 sb.write('\nExpected collection does not contain: ');
198 } 199 }
199 for (let val of missingSet) { 200 for (let val of missingSet) {
200 sb.write(`${val} `); 201 sb.write(`${val} `);
201 } 202 }
202 if (!dart.notNull(extraSet.isEmpty)) { 203 if (!dart.notNull(extraSet.isEmpty)) {
203 sb.write('\nExpected collection should not contain: '); 204 sb.write('\nExpected collection should not contain: ');
204 } 205 }
205 for (let val of extraSet) { 206 for (let val of extraSet) {
206 sb.write(`${val} `); 207 sb.write(`${val} `);
207 } 208 }
208 Expect._fail(sb.toString()); 209 expect.Expect._fail(sb.toString());
209 } 210 }
210 static throws(f, check, reason) { 211 static throws(f, check, reason) {
211 if (check === void 0) check = null; 212 if (check === void 0) check = null;
212 if (reason === void 0) reason = null; 213 if (reason === void 0) reason = null;
213 let msg = reason == null ? "" : `(${reason})`; 214 let msg = reason == null ? "" : `(${reason})`;
214 if (!dart.is(f, _Nullary)) { 215 if (!dart.is(f, expect._Nullary)) {
215 Expect._fail(`Expect.throws${msg}: Function f not callable with zero arg uments`); 216 expect.Expect._fail(`Expect.throws${msg}: Function f not callable with z ero arguments`);
216 } 217 }
217 try { 218 try {
218 f(); 219 f();
219 } catch (e) { 220 } catch (e) {
220 let s = dart.stackTrace(e); 221 let s = dart.stackTrace(e);
221 if (check != null) { 222 if (check != null) {
222 if (!dart.notNull(dart.dcall(check, e))) { 223 if (!dart.notNull(dart.dcall(check, e))) {
223 Expect._fail(`Expect.throws${msg}: Unexpected '${e}'\n${s}`); 224 expect.Expect._fail(`Expect.throws${msg}: Unexpected '${e}'\n${s}`);
224 } 225 }
225 } 226 }
226 return; 227 return;
227 } 228 }
228 229
229 Expect._fail(`Expect.throws${msg} fails: Did not throw`); 230 expect.Expect._fail(`Expect.throws${msg} fails: Did not throw`);
230 } 231 }
231 static _getMessage(reason) { 232 static _getMessage(reason) {
232 return reason == null ? "" : `, '${reason}'`; 233 return reason == null ? "" : `, '${reason}'`;
233 } 234 }
234 static _fail(message) { 235 static _fail(message) {
235 dart.throw(new ExpectException(message)); 236 dart.throw(new expect.ExpectException(message));
236 } 237 }
237 } 238 };
238 dart.setSignature(Expect, { 239 dart.setSignature(expect.Expect, {
239 statics: () => ({ 240 statics: () => ({
240 _truncateString: [core.String, [core.String, core.int, core.int, core.int] ], 241 _truncateString: [core.String, [core.String, core.int, core.int, core.int] ],
241 _stringDifference: [core.String, [core.String, core.String]], 242 _stringDifference: [core.String, [core.String, core.String]],
242 equals: [dart.void, [dart.dynamic, dart.dynamic], [core.String]], 243 equals: [dart.void, [dart.dynamic, dart.dynamic], [core.String]],
243 isTrue: [dart.void, [dart.dynamic], [core.String]], 244 isTrue: [dart.void, [dart.dynamic], [core.String]],
244 isFalse: [dart.void, [dart.dynamic], [core.String]], 245 isFalse: [dart.void, [dart.dynamic], [core.String]],
245 isNull: [dart.void, [dart.dynamic], [core.String]], 246 isNull: [dart.void, [dart.dynamic], [core.String]],
246 isNotNull: [dart.void, [dart.dynamic], [core.String]], 247 isNotNull: [dart.void, [dart.dynamic], [core.String]],
247 identical: [dart.void, [dart.dynamic, dart.dynamic], [core.String]], 248 identical: [dart.void, [dart.dynamic, dart.dynamic], [core.String]],
248 fail: [dart.void, [core.String]], 249 fail: [dart.void, [core.String]],
249 approxEquals: [dart.void, [core.num, core.num], [core.num, core.String]], 250 approxEquals: [dart.void, [core.num, core.num], [core.num, core.String]],
250 notEquals: [dart.void, [dart.dynamic, dart.dynamic], [core.String]], 251 notEquals: [dart.void, [dart.dynamic, dart.dynamic], [core.String]],
251 listEquals: [dart.void, [core.List, core.List], [core.String]], 252 listEquals: [dart.void, [core.List, core.List], [core.String]],
252 mapEquals: [dart.void, [core.Map, core.Map], [core.String]], 253 mapEquals: [dart.void, [core.Map, core.Map], [core.String]],
253 stringEquals: [dart.void, [core.String, core.String], [core.String]], 254 stringEquals: [dart.void, [core.String, core.String], [core.String]],
254 setEquals: [dart.void, [core.Iterable, core.Iterable], [core.String]], 255 setEquals: [dart.void, [core.Iterable, core.Iterable], [core.String]],
255 throws: [dart.void, [dart.functionType(dart.void, [])], [_CheckExceptionFn , core.String]], 256 throws: [dart.void, [dart.functionType(dart.void, [])], [expect._CheckExce ptionFn, core.String]],
256 _getMessage: [core.String, [core.String]], 257 _getMessage: [core.String, [core.String]],
257 _fail: [dart.void, [core.String]] 258 _fail: [dart.void, [core.String]]
258 }), 259 }),
259 names: ['_truncateString', '_stringDifference', 'equals', 'isTrue', 'isFalse ', 'isNull', 'isNotNull', 'identical', 'fail', 'approxEquals', 'notEquals', 'lis tEquals', 'mapEquals', 'stringEquals', 'setEquals', 'throws', '_getMessage', '_f ail'] 260 names: ['_truncateString', '_stringDifference', 'equals', 'isTrue', 'isFalse ', 'isNull', 'isNotNull', 'identical', 'fail', 'approxEquals', 'notEquals', 'lis tEquals', 'mapEquals', 'stringEquals', 'setEquals', 'throws', '_getMessage', '_f ail']
260 }); 261 });
261 function _identical(a, b) { 262 expect._identical = function(a, b) {
262 return core.identical(a, b); 263 return core.identical(a, b);
263 } 264 };
264 dart.fn(_identical, core.bool, [dart.dynamic, dart.dynamic]); 265 dart.fn(expect._identical, core.bool, [dart.dynamic, dart.dynamic]);
265 const _CheckExceptionFn = dart.typedef('_CheckExceptionFn', () => dart.functio nType(core.bool, [dart.dynamic])); 266 expect._CheckExceptionFn = dart.typedef('_CheckExceptionFn', () => dart.functi onType(core.bool, [dart.dynamic]));
266 const _Nullary = dart.typedef('_Nullary', () => dart.functionType(dart.dynamic , [])); 267 expect._Nullary = dart.typedef('_Nullary', () => dart.functionType(dart.dynami c, []));
267 class ExpectException extends core.Object { 268 expect.ExpectException = class ExpectException extends core.Object {
268 ExpectException(message) { 269 ExpectException(message) {
269 this.message = message; 270 this.message = message;
270 } 271 }
271 toString() { 272 toString() {
272 return this.message; 273 return this.message;
273 } 274 }
274 } 275 };
275 ExpectException[dart.implements] = () => [core.Exception]; 276 expect.ExpectException[dart.implements] = () => [core.Exception];
276 dart.setSignature(ExpectException, { 277 dart.setSignature(expect.ExpectException, {
277 constructors: () => ({ExpectException: [ExpectException, [core.String]]}) 278 constructors: () => ({ExpectException: [expect.ExpectException, [core.String ]]})
278 }); 279 });
279 class NoInline extends core.Object { 280 expect.NoInline = class NoInline extends core.Object {
280 NoInline() { 281 NoInline() {
281 } 282 }
282 } 283 };
283 dart.setSignature(NoInline, { 284 dart.setSignature(expect.NoInline, {
284 constructors: () => ({NoInline: [NoInline, []]}) 285 constructors: () => ({NoInline: [expect.NoInline, []]})
285 }); 286 });
286 class TrustTypeAnnotations extends core.Object { 287 expect.TrustTypeAnnotations = class TrustTypeAnnotations extends core.Object {
287 TrustTypeAnnotations() { 288 TrustTypeAnnotations() {
288 } 289 }
289 } 290 };
290 dart.setSignature(TrustTypeAnnotations, { 291 dart.setSignature(expect.TrustTypeAnnotations, {
291 constructors: () => ({TrustTypeAnnotations: [TrustTypeAnnotations, []]}) 292 constructors: () => ({TrustTypeAnnotations: [expect.TrustTypeAnnotations, [] ]})
292 }); 293 });
293 class AssumeDynamic extends core.Object { 294 expect.AssumeDynamic = class AssumeDynamic extends core.Object {
294 AssumeDynamic() { 295 AssumeDynamic() {
295 } 296 }
296 } 297 };
297 dart.setSignature(AssumeDynamic, { 298 dart.setSignature(expect.AssumeDynamic, {
298 constructors: () => ({AssumeDynamic: [AssumeDynamic, []]}) 299 constructors: () => ({AssumeDynamic: [expect.AssumeDynamic, []]})
299 }); 300 });
300 // Exports: 301 // Exports:
301 exports.Expect = Expect; 302 exports.expect = expect;
302 exports.ExpectException = ExpectException;
303 exports.NoInline = NoInline;
304 exports.TrustTypeAnnotations = TrustTypeAnnotations;
305 exports.AssumeDynamic = AssumeDynamic;
306 }); 303 });
OLDNEW
« no previous file with comments | « test/codegen/expect/es6_modules.txt ('k') | test/codegen/expect/expect.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698