OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Test that the compiler emits a warning on import of 'dart:mirrors' unless | 5 // Test that the compiler emits a warning on import of 'dart:mirrors' unless |
6 // the flag --enable-experimental-mirrors is used. | 6 // the flag --enable-experimental-mirrors is used. |
7 | 7 |
8 library dart2js.test.import_mirrors; | 8 library dart2js.test.import_mirrors; |
9 | 9 |
10 import 'dart:async'; | 10 import 'dart:async'; |
11 import 'package:expect/expect.dart'; | 11 import 'package:expect/expect.dart'; |
12 import 'package:async_helper/async_helper.dart'; | 12 import 'package:async_helper/async_helper.dart'; |
13 import 'package:compiler/src/diagnostics/messages.dart' show | 13 import 'package:compiler/src/diagnostics/messages.dart' |
14 MessageKind, | 14 show MessageKind, MessageTemplate; |
15 MessageTemplate; | |
16 import 'memory_compiler.dart'; | 15 import 'memory_compiler.dart'; |
17 | 16 |
18 const DIRECT_IMPORT = const { | 17 const DIRECT_IMPORT = const { |
19 '/main.dart': ''' | 18 '/main.dart': ''' |
20 import 'dart:mirrors'; | 19 import 'dart:mirrors'; |
21 | 20 |
22 main() {} | 21 main() {} |
23 ''', | 22 ''', |
24 | 23 'paths': "main.dart => dart:mirrors", |
25 'paths': | |
26 "main.dart => dart:mirrors", | |
27 }; | 24 }; |
28 | 25 |
29 const INDIRECT_IMPORT1 = const { | 26 const INDIRECT_IMPORT1 = const { |
30 '/main.dart': ''' | 27 '/main.dart': ''' |
31 import 'first.dart'; | 28 import 'first.dart'; |
32 | 29 |
33 main() {} | 30 main() {} |
34 ''', | 31 ''', |
35 '/first.dart': ''' | 32 '/first.dart': ''' |
36 import 'dart:mirrors'; | 33 import 'dart:mirrors'; |
37 ''', | 34 ''', |
38 | 35 'paths': "first.dart => dart:mirrors", |
39 'paths': | 36 'verbosePaths': "main.dart => first.dart => dart:mirrors", |
40 "first.dart => dart:mirrors", | |
41 'verbosePaths': | |
42 "main.dart => first.dart => dart:mirrors", | |
43 }; | 37 }; |
44 | 38 |
45 const INDIRECT_IMPORT2 = const { | 39 const INDIRECT_IMPORT2 = const { |
46 '/main.dart': ''' | 40 '/main.dart': ''' |
47 import 'first.dart'; | 41 import 'first.dart'; |
48 | 42 |
49 main() {} | 43 main() {} |
50 ''', | 44 ''', |
51 '/first.dart': ''' | 45 '/first.dart': ''' |
52 import 'second.dart'; | 46 import 'second.dart'; |
53 ''', | 47 ''', |
54 '/second.dart': ''' | 48 '/second.dart': ''' |
55 import 'dart:mirrors'; | 49 import 'dart:mirrors'; |
56 ''', | 50 ''', |
57 | 51 'paths': "second.dart => dart:mirrors", |
58 'paths': | 52 'verbosePaths': "main.dart => first.dart => second.dart => dart:mirrors", |
59 "second.dart => dart:mirrors", | |
60 'verbosePaths': | |
61 "main.dart => first.dart => second.dart => dart:mirrors", | |
62 }; | 53 }; |
63 | 54 |
64 const INDIRECT_PACKAGE_IMPORT1 = const { | 55 const INDIRECT_PACKAGE_IMPORT1 = const { |
65 '/main.dart': ''' | 56 '/main.dart': ''' |
66 import 'first.dart'; | 57 import 'first.dart'; |
67 | 58 |
68 main() {} | 59 main() {} |
69 ''', | 60 ''', |
70 '/first.dart': ''' | 61 '/first.dart': ''' |
71 import 'package:second/second.dart'; | 62 import 'package:second/second.dart'; |
72 ''', | 63 ''', |
73 '/pkg/second/second.dart': ''' | 64 '/pkg/second/second.dart': ''' |
74 import 'dart:mirrors'; | 65 import 'dart:mirrors'; |
75 ''', | 66 ''', |
76 | 67 'paths': "first.dart => package:second => dart:mirrors", |
77 'paths': | |
78 "first.dart => package:second => dart:mirrors", | |
79 'verbosePaths': | 68 'verbosePaths': |
80 "main.dart => first.dart => package:second/second.dart => dart:mirrors", | 69 "main.dart => first.dart => package:second/second.dart => dart:mirrors", |
81 }; | 70 }; |
82 | 71 |
83 const INDIRECT_PACKAGE_IMPORT2 = const { | 72 const INDIRECT_PACKAGE_IMPORT2 = const { |
84 '/main.dart': ''' | 73 '/main.dart': ''' |
85 import 'first.dart'; | 74 import 'first.dart'; |
86 | 75 |
87 main() {} | 76 main() {} |
88 ''', | 77 ''', |
89 '/first.dart': ''' | 78 '/first.dart': ''' |
90 import 'package:packagename/second.dart'; | 79 import 'package:packagename/second.dart'; |
91 ''', | 80 ''', |
92 '/pkg/packagename/second.dart': ''' | 81 '/pkg/packagename/second.dart': ''' |
93 import 'dart:mirrors'; | 82 import 'dart:mirrors'; |
94 ''', | 83 ''', |
95 | 84 'paths': "first.dart => package:packagename => dart:mirrors", |
96 'paths': | 85 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart " |
97 "first.dart => package:packagename => dart:mirrors", | |
98 'verbosePaths': | |
99 "main.dart => first.dart => package:packagename/second.dart " | |
100 "=> dart:mirrors", | 86 "=> dart:mirrors", |
101 }; | 87 }; |
102 | 88 |
103 const INDIRECT_PACKAGE_IMPORT3 = const { | 89 const INDIRECT_PACKAGE_IMPORT3 = const { |
104 '/main.dart': ''' | 90 '/main.dart': ''' |
105 import 'first.dart'; | 91 import 'first.dart'; |
106 | 92 |
107 main() {} | 93 main() {} |
108 ''', | 94 ''', |
109 '/first.dart': ''' | 95 '/first.dart': ''' |
110 import 'package:package1/second.dart'; | 96 import 'package:package1/second.dart'; |
111 ''', | 97 ''', |
112 '/pkg/package1/second.dart': ''' | 98 '/pkg/package1/second.dart': ''' |
113 import 'package:package2/third.dart'; | 99 import 'package:package2/third.dart'; |
114 ''', | 100 ''', |
115 '/pkg/package2/third.dart': ''' | 101 '/pkg/package2/third.dart': ''' |
116 import 'dart:mirrors'; | 102 import 'dart:mirrors'; |
117 ''', | 103 ''', |
118 | 104 'paths': "first.dart => package:package1 => package:package2 => dart:mirrors", |
119 'paths': | 105 'verbosePaths': "main.dart => first.dart => package:package1/second.dart " |
120 "first.dart => package:package1 => package:package2 => dart:mirrors", | |
121 'verbosePaths': | |
122 "main.dart => first.dart => package:package1/second.dart " | |
123 "=> package:package2/third.dart => dart:mirrors", | 106 "=> package:package2/third.dart => dart:mirrors", |
124 }; | 107 }; |
125 | 108 |
126 const INDIRECT_PACKAGE_IMPORT4 = const { | 109 const INDIRECT_PACKAGE_IMPORT4 = const { |
127 '/main.dart': ''' | 110 '/main.dart': ''' |
128 import 'first.dart'; | 111 import 'first.dart'; |
129 | 112 |
130 main() {} | 113 main() {} |
131 ''', | 114 ''', |
132 '/first.dart': ''' | 115 '/first.dart': ''' |
133 import 'package:package1/second.dart'; | 116 import 'package:package1/second.dart'; |
134 ''', | 117 ''', |
135 '/pkg/package1/second.dart': ''' | 118 '/pkg/package1/second.dart': ''' |
136 import 'sub/third.dart'; | 119 import 'sub/third.dart'; |
137 ''', | 120 ''', |
138 '/pkg/package1/sub/third.dart': ''' | 121 '/pkg/package1/sub/third.dart': ''' |
139 import 'package:package2/fourth.dart'; | 122 import 'package:package2/fourth.dart'; |
140 ''', | 123 ''', |
141 '/pkg/package2/fourth.dart': ''' | 124 '/pkg/package2/fourth.dart': ''' |
142 import 'lib/src/fifth.dart'; | 125 import 'lib/src/fifth.dart'; |
143 ''', | 126 ''', |
144 '/pkg/package2/lib/src/fifth.dart': ''' | 127 '/pkg/package2/lib/src/fifth.dart': ''' |
145 import 'dart:mirrors'; | 128 import 'dart:mirrors'; |
146 ''', | 129 ''', |
147 | 130 'paths': "first.dart => package:package1 => package:package2 => dart:mirrors", |
148 'paths': | 131 'verbosePaths': "main.dart => first.dart => package:package1/second.dart " |
149 "first.dart => package:package1 => package:package2 => dart:mirrors", | |
150 'verbosePaths': | |
151 "main.dart => first.dart => package:package1/second.dart " | |
152 "=> package:package1/sub/third.dart => package:package2/fourth.dart " | 132 "=> package:package1/sub/third.dart => package:package2/fourth.dart " |
153 "=> package:package2/lib/src/fifth.dart => dart:mirrors", | 133 "=> package:package2/lib/src/fifth.dart => dart:mirrors", |
154 }; | 134 }; |
155 | 135 |
156 const DUAL_DIRECT_IMPORT = const { | 136 const DUAL_DIRECT_IMPORT = const { |
157 '/main.dart': ''' | 137 '/main.dart': ''' |
158 import 'dart:mirrors'; | 138 import 'dart:mirrors'; |
159 import 'dart:mirrors'; | 139 import 'dart:mirrors'; |
160 | 140 |
161 main() {} | 141 main() {} |
162 ''', | 142 ''', |
163 | 143 'paths': "main.dart => dart:mirrors", |
164 'paths': | |
165 "main.dart => dart:mirrors", | |
166 }; | 144 }; |
167 | 145 |
168 const DUAL_INDIRECT_IMPORT1 = const { | 146 const DUAL_INDIRECT_IMPORT1 = const { |
169 '/main.dart': ''' | 147 '/main.dart': ''' |
170 import 'dart:mirrors'; | 148 import 'dart:mirrors'; |
171 import 'first.dart'; | 149 import 'first.dart'; |
172 | 150 |
173 main() {} | 151 main() {} |
174 ''', | 152 ''', |
175 '/first.dart': ''' | 153 '/first.dart': ''' |
176 import 'dart:mirrors'; | 154 import 'dart:mirrors'; |
177 ''', | 155 ''', |
178 | 156 'paths': const ["main.dart => dart:mirrors", "first.dart => dart:mirrors"], |
179 'paths': const | 157 'verbosePaths': const [ |
180 ["main.dart => dart:mirrors", | 158 "main.dart => dart:mirrors", |
181 "first.dart => dart:mirrors"], | 159 "main.dart => first.dart => dart:mirrors" |
182 'verbosePaths': const | 160 ], |
183 ["main.dart => dart:mirrors", | |
184 "main.dart => first.dart => dart:mirrors"], | |
185 }; | 161 }; |
186 | 162 |
187 const DUAL_INDIRECT_IMPORT2 = const { | 163 const DUAL_INDIRECT_IMPORT2 = const { |
188 '/main.dart': ''' | 164 '/main.dart': ''' |
189 import 'first.dart'; | 165 import 'first.dart'; |
190 import 'second.dart'; | 166 import 'second.dart'; |
191 | 167 |
192 main() {} | 168 main() {} |
193 ''', | 169 ''', |
194 '/first.dart': ''' | 170 '/first.dart': ''' |
195 import 'dart:mirrors'; | 171 import 'dart:mirrors'; |
196 ''', | 172 ''', |
197 '/second.dart': ''' | 173 '/second.dart': ''' |
198 import 'dart:mirrors'; | 174 import 'dart:mirrors'; |
199 ''', | 175 ''', |
200 | 176 'paths': const ["first.dart => dart:mirrors", "second.dart => dart:mirrors"], |
201 'paths': const | 177 'verbosePaths': const [ |
202 ["first.dart => dart:mirrors", | 178 "main.dart => first.dart => dart:mirrors", |
203 "second.dart => dart:mirrors"], | 179 "main.dart => second.dart => dart:mirrors" |
204 'verbosePaths': const | 180 ], |
205 ["main.dart => first.dart => dart:mirrors", | |
206 "main.dart => second.dart => dart:mirrors"], | |
207 }; | 181 }; |
208 | 182 |
209 const DUAL_INDIRECT_IMPORT3 = const { | 183 const DUAL_INDIRECT_IMPORT3 = const { |
210 '/main.dart': ''' | 184 '/main.dart': ''' |
211 import 'first.dart'; | 185 import 'first.dart'; |
212 import 'second.dart'; | 186 import 'second.dart'; |
213 | 187 |
214 main() {} | 188 main() {} |
215 ''', | 189 ''', |
216 '/first.dart': ''' | 190 '/first.dart': ''' |
217 import 'third.dart'; | 191 import 'third.dart'; |
218 ''', | 192 ''', |
219 '/second.dart': ''' | 193 '/second.dart': ''' |
220 import 'third.dart'; | 194 import 'third.dart'; |
221 ''', | 195 ''', |
222 '/third.dart': ''' | 196 '/third.dart': ''' |
223 import 'dart:mirrors'; | 197 import 'dart:mirrors'; |
224 ''', | 198 ''', |
225 | 199 'paths': "third.dart => dart:mirrors", |
226 'paths': | 200 'verbosePaths': const [ |
227 "third.dart => dart:mirrors", | 201 "main.dart => first.dart => third.dart => dart:mirrors", |
228 'verbosePaths': const | 202 "main.dart => second.dart => third.dart => dart:mirrors" |
229 ["main.dart => first.dart => third.dart => dart:mirrors", | 203 ], |
230 "main.dart => second.dart => third.dart => dart:mirrors"], | |
231 }; | 204 }; |
232 | 205 |
233 const DUAL_INDIRECT_PACKAGE_IMPORT1 = const { | 206 const DUAL_INDIRECT_PACKAGE_IMPORT1 = const { |
234 '/main.dart': ''' | 207 '/main.dart': ''' |
235 import 'package:package1/second.dart'; | 208 import 'package:package1/second.dart'; |
236 import 'first.dart'; | 209 import 'first.dart'; |
237 | 210 |
238 main() {} | 211 main() {} |
239 ''', | 212 ''', |
240 '/first.dart': ''' | 213 '/first.dart': ''' |
241 import 'package:package2/third.dart'; | 214 import 'package:package2/third.dart'; |
242 ''', | 215 ''', |
243 '/pkg/package1/second.dart': ''' | 216 '/pkg/package1/second.dart': ''' |
244 import 'dart:mirrors'; | 217 import 'dart:mirrors'; |
245 ''', | 218 ''', |
246 '/pkg/package2/third.dart': ''' | 219 '/pkg/package2/third.dart': ''' |
247 import 'dart:mirrors'; | 220 import 'dart:mirrors'; |
248 ''', | 221 ''', |
249 | 222 'paths': const [ |
250 'paths': const | 223 "main.dart => package:package1 => dart:mirrors", |
251 ["main.dart => package:package1 => dart:mirrors", | 224 "first.dart => package:package2 => dart:mirrors" |
252 "first.dart => package:package2 => dart:mirrors"], | 225 ], |
253 'verbosePaths': const | 226 'verbosePaths': const [ |
254 ["main.dart => package:package1/second.dart => dart:mirrors", | 227 "main.dart => package:package1/second.dart => dart:mirrors", |
255 "main.dart => first.dart => package:package2/third.dart => dart:mirrors"] | 228 "main.dart => first.dart => package:package2/third.dart => dart:mirrors" |
| 229 ] |
256 }; | 230 }; |
257 | 231 |
258 const DIRECT_EXPORT = const { | 232 const DIRECT_EXPORT = const { |
259 '/main.dart': ''' | 233 '/main.dart': ''' |
260 export 'dart:mirrors'; | 234 export 'dart:mirrors'; |
261 | 235 |
262 main() {} | 236 main() {} |
263 ''', | 237 ''', |
264 | 238 'paths': "main.dart => dart:mirrors", |
265 'paths': | |
266 "main.dart => dart:mirrors", | |
267 }; | 239 }; |
268 | 240 |
269 const INDIRECT_EXPORT1 = const { | 241 const INDIRECT_EXPORT1 = const { |
270 '/main.dart': ''' | 242 '/main.dart': ''' |
271 import 'first.dart'; | 243 import 'first.dart'; |
272 | 244 |
273 main() {} | 245 main() {} |
274 ''', | 246 ''', |
275 '/first.dart': ''' | 247 '/first.dart': ''' |
276 export 'dart:mirrors'; | 248 export 'dart:mirrors'; |
277 ''', | 249 ''', |
278 | 250 'paths': "first.dart => dart:mirrors", |
279 'paths': | 251 'verbosePaths': "main.dart => first.dart => dart:mirrors", |
280 "first.dart => dart:mirrors", | |
281 'verbosePaths': | |
282 "main.dart => first.dart => dart:mirrors", | |
283 }; | 252 }; |
284 | 253 |
285 const INDIRECT_EXPORT2 = const { | 254 const INDIRECT_EXPORT2 = const { |
286 '/main.dart': ''' | 255 '/main.dart': ''' |
287 import 'first.dart'; | 256 import 'first.dart'; |
288 | 257 |
289 main() {} | 258 main() {} |
290 ''', | 259 ''', |
291 '/first.dart': ''' | 260 '/first.dart': ''' |
292 import 'second.dart'; | 261 import 'second.dart'; |
293 ''', | 262 ''', |
294 '/second.dart': ''' | 263 '/second.dart': ''' |
295 export 'dart:mirrors'; | 264 export 'dart:mirrors'; |
296 ''', | 265 ''', |
297 | 266 'paths': "second.dart => dart:mirrors", |
298 'paths': | 267 'verbosePaths': "main.dart => first.dart => second.dart => dart:mirrors", |
299 "second.dart => dart:mirrors", | |
300 'verbosePaths': | |
301 "main.dart => first.dart => second.dart => dart:mirrors", | |
302 }; | 268 }; |
303 | 269 |
304 const INDIRECT_PACKAGE_EXPORT1 = const { | 270 const INDIRECT_PACKAGE_EXPORT1 = const { |
305 '/main.dart': ''' | 271 '/main.dart': ''' |
306 import 'first.dart'; | 272 import 'first.dart'; |
307 | 273 |
308 main() {} | 274 main() {} |
309 ''', | 275 ''', |
310 '/first.dart': ''' | 276 '/first.dart': ''' |
311 import 'package:packagename/second.dart'; | 277 import 'package:packagename/second.dart'; |
312 ''', | 278 ''', |
313 '/pkg/packagename/second.dart': ''' | 279 '/pkg/packagename/second.dart': ''' |
314 export 'dart:mirrors'; | 280 export 'dart:mirrors'; |
315 ''', | 281 ''', |
316 | 282 'paths': "first.dart => package:packagename => dart:mirrors", |
317 'paths': | 283 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart " |
318 "first.dart => package:packagename => dart:mirrors", | |
319 'verbosePaths': | |
320 "main.dart => first.dart => package:packagename/second.dart " | |
321 "=> dart:mirrors", | 284 "=> dart:mirrors", |
322 }; | 285 }; |
323 | 286 |
324 const INDIRECT_PACKAGE_EXPORT2 = const { | 287 const INDIRECT_PACKAGE_EXPORT2 = const { |
325 '/main.dart': ''' | 288 '/main.dart': ''' |
326 import 'first.dart'; | 289 import 'first.dart'; |
327 | 290 |
328 main() {} | 291 main() {} |
329 ''', | 292 ''', |
330 '/first.dart': ''' | 293 '/first.dart': ''' |
331 export 'package:packagename/second.dart'; | 294 export 'package:packagename/second.dart'; |
332 ''', | 295 ''', |
333 '/pkg/packagename/second.dart': ''' | 296 '/pkg/packagename/second.dart': ''' |
334 import 'dart:mirrors'; | 297 import 'dart:mirrors'; |
335 ''', | 298 ''', |
336 | 299 'paths': "first.dart => package:packagename => dart:mirrors", |
337 'paths': | 300 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart " |
338 "first.dart => package:packagename => dart:mirrors", | |
339 'verbosePaths': | |
340 "main.dart => first.dart => package:packagename/second.dart " | |
341 "=> dart:mirrors", | 301 "=> dart:mirrors", |
342 }; | 302 }; |
343 | 303 |
344 Future test(Map sourceFiles, | 304 Future test(Map sourceFiles, |
345 {expectedPaths, | 305 {expectedPaths, |
346 bool verbose: false, | 306 bool verbose: false, |
347 bool enableExperimentalMirrors: false}) async { | 307 bool enableExperimentalMirrors: false}) async { |
348 if (expectedPaths is! List) { | 308 if (expectedPaths is! List) { |
349 expectedPaths = [expectedPaths]; | 309 expectedPaths = [expectedPaths]; |
350 } | 310 } |
351 var collector = new DiagnosticCollector(); | 311 var collector = new DiagnosticCollector(); |
352 var options = []; | 312 var options = []; |
353 if (verbose) { | 313 if (verbose) { |
354 options.add('--verbose'); | 314 options.add('--verbose'); |
355 } | 315 } |
356 if (enableExperimentalMirrors) { | 316 if (enableExperimentalMirrors) { |
357 options.add('--enable-experimental-mirrors'); | 317 options.add('--enable-experimental-mirrors'); |
358 } | 318 } |
359 CompilationResult result = await runCompiler( | 319 CompilationResult result = await runCompiler( |
360 entryPoint: Uri.parse('memory:/main.dart'), | 320 entryPoint: Uri.parse('memory:/main.dart'), |
361 memorySourceFiles: sourceFiles, | 321 memorySourceFiles: sourceFiles, |
362 diagnosticHandler: collector, | 322 diagnosticHandler: collector, |
363 packageRoot: Uri.parse('memory:/pkg/'), | 323 packageRoot: Uri.parse('memory:/pkg/'), |
364 options: options); | 324 options: options); |
365 Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}'); | 325 Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}'); |
366 if (enableExperimentalMirrors) { | 326 if (enableExperimentalMirrors) { |
367 Expect.equals(0, collector.warnings.length, | 327 Expect.equals( |
368 'Warnings: ${collector.errors}'); | 328 0, collector.warnings.length, 'Warnings: ${collector.errors}'); |
369 } else { | 329 } else { |
370 Expect.equals(1, collector.warnings.length, | |
371 'Warnings: ${collector.errors}'); | |
372 Expect.equals( | 330 Expect.equals( |
373 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, | 331 1, collector.warnings.length, 'Warnings: ${collector.errors}'); |
| 332 Expect.equals(MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, |
374 collector.warnings.first.message.kind); | 333 collector.warnings.first.message.kind); |
375 Expect.equals( | 334 Expect.equals( |
376 expectedPaths.join(MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING), | 335 expectedPaths.join(MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING), |
377 collector.warnings.first.message.arguments['importChain']); | 336 collector.warnings.first.message.arguments['importChain']); |
378 } | 337 } |
379 } | 338 } |
380 | 339 |
381 Future checkPaths(Map sourceData) { | 340 Future checkPaths(Map sourceData) { |
382 Map sourceFiles = sourceData; | 341 Map sourceFiles = sourceData; |
383 var expectedPaths = sourceData['paths']; | 342 var expectedPaths = sourceData['paths']; |
384 var expectedVerbosePaths = sourceData['verbosePaths']; | 343 var expectedVerbosePaths = sourceData['verbosePaths']; |
385 if (expectedVerbosePaths == null) { | 344 if (expectedVerbosePaths == null) { |
386 expectedVerbosePaths = expectedPaths; | 345 expectedVerbosePaths = expectedPaths; |
387 } | 346 } |
388 return test(sourceFiles, expectedPaths: expectedPaths).then((_) { | 347 return test(sourceFiles, expectedPaths: expectedPaths).then((_) { |
389 return test( | 348 return test(sourceFiles, |
390 sourceFiles, expectedPaths: expectedVerbosePaths, verbose: true); | 349 expectedPaths: expectedVerbosePaths, verbose: true); |
391 }).then((_) { | 350 }).then((_) { |
392 return test(sourceFiles, enableExperimentalMirrors: true); | 351 return test(sourceFiles, enableExperimentalMirrors: true); |
393 }); | 352 }); |
394 } | 353 } |
395 | 354 |
396 void main() { | 355 void main() { |
397 asyncTest(() => Future.forEach([ | 356 asyncTest(() => Future.forEach([ |
398 DIRECT_IMPORT, | 357 DIRECT_IMPORT, |
399 INDIRECT_IMPORT1, | 358 INDIRECT_IMPORT1, |
400 INDIRECT_IMPORT2, | 359 INDIRECT_IMPORT2, |
401 INDIRECT_PACKAGE_IMPORT1, | 360 INDIRECT_PACKAGE_IMPORT1, |
402 INDIRECT_PACKAGE_IMPORT2, | 361 INDIRECT_PACKAGE_IMPORT2, |
403 INDIRECT_PACKAGE_IMPORT3, | 362 INDIRECT_PACKAGE_IMPORT3, |
404 INDIRECT_PACKAGE_IMPORT4, | 363 INDIRECT_PACKAGE_IMPORT4, |
405 DUAL_DIRECT_IMPORT, | 364 DUAL_DIRECT_IMPORT, |
406 DUAL_INDIRECT_IMPORT1, | 365 DUAL_INDIRECT_IMPORT1, |
407 DUAL_INDIRECT_IMPORT2, | 366 DUAL_INDIRECT_IMPORT2, |
408 DUAL_INDIRECT_IMPORT3, | 367 DUAL_INDIRECT_IMPORT3, |
409 DUAL_INDIRECT_PACKAGE_IMPORT1, | 368 DUAL_INDIRECT_PACKAGE_IMPORT1, |
410 DIRECT_EXPORT, | 369 DIRECT_EXPORT, |
411 INDIRECT_EXPORT1, | 370 INDIRECT_EXPORT1, |
412 INDIRECT_EXPORT2, | 371 INDIRECT_EXPORT2, |
413 INDIRECT_PACKAGE_EXPORT1, | 372 INDIRECT_PACKAGE_EXPORT1, |
414 INDIRECT_PACKAGE_EXPORT2], | 373 INDIRECT_PACKAGE_EXPORT2 |
415 (map) => checkPaths(map) | 374 ], (map) => checkPaths(map))); |
416 )); | |
417 } | 375 } |
OLD | NEW |