| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library initialize.transformer_test; | 4 library initialize.transformer_test; |
| 5 | 5 |
| 6 import 'common.dart'; | 6 import 'common.dart'; |
| 7 import 'package:analyzer/src/generated/element.dart'; | 7 import 'package:analyzer/src/generated/element.dart'; |
| 8 import 'package:dart_style/dart_style.dart'; | 8 import 'package:dart_style/dart_style.dart'; |
| 9 import 'package:initialize/transformer.dart'; | 9 import 'package:initialize/transformer.dart'; |
| 10 import 'package:unittest/compact_vm_config.dart'; | 10 import 'package:unittest/compact_vm_config.dart'; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 testPhases('imports from exported libraries', phases, { | 238 testPhases('imports from exported libraries', phases, { |
| 239 'a|web/index.dart': ''' | 239 'a|web/index.dart': ''' |
| 240 library web_foo; | 240 library web_foo; |
| 241 | 241 |
| 242 export 'foo.dart'; | 242 export 'foo.dart'; |
| 243 ''', | 243 ''', |
| 244 'a|web/foo.dart': ''' | 244 'a|web/foo.dart': ''' |
| 245 library foo; | 245 library foo; |
| 246 | 246 |
| 247 import 'bar.dart'; | 247 import 'foo/bar.dart'; |
| 248 ''', | 248 ''', |
| 249 'a|web/bar.dart': ''' | 249 'a|web/foo/bar.dart': ''' |
| 250 @constInit | 250 @constInit |
| 251 library bar; | 251 library bar; |
| 252 | 252 |
| 253 import 'package:test_initializers/common.dart'; | 253 import 'package:test_initializers/common.dart'; |
| 254 | 254 |
| 255 @constInit | 255 @constInit |
| 256 bar() {}; | 256 bar() {}; |
| 257 | 257 |
| 258 @constInit | 258 @constInit |
| 259 class Bar {} | 259 class Bar {} |
| 260 ''', | 260 ''', |
| 261 // Mock out the Initialize package plus some initializers. | 261 // Mock out the Initialize package plus some initializers. |
| 262 'initialize|lib/initialize.dart': mockInitialize, | 262 'initialize|lib/initialize.dart': mockInitialize, |
| 263 'test_initializers|lib/common.dart': commonInitializers, | 263 'test_initializers|lib/common.dart': commonInitializers, |
| 264 }, { | 264 }, { |
| 265 'a|web/index.initialize.dart': formatter.format(''' | 265 'a|web/index.initialize.dart': formatter.format(''' |
| 266 import 'package:initialize/src/static_loader.dart'; | 266 import 'package:initialize/src/static_loader.dart'; |
| 267 import 'package:initialize/initialize.dart'; | 267 import 'package:initialize/initialize.dart'; |
| 268 import 'index.dart' as i0; | 268 import 'index.dart' as i0; |
| 269 import 'bar.dart' as i1; | 269 import 'foo/bar.dart' as i1; |
| 270 import 'package:test_initializers/common.dart' as i2; | 270 import 'package:test_initializers/common.dart' as i2; |
| 271 | 271 |
| 272 main() { | 272 main() { |
| 273 initializers.addAll([ | 273 initializers.addAll([ |
| 274 new InitEntry(i2.constInit, const LibraryIdentifier(#bar, null, 'bar
.dart')), | 274 new InitEntry(i2.constInit, const LibraryIdentifier(#bar, null, 'foo
/bar.dart')), |
| 275 new InitEntry(i2.constInit, i1.bar), | 275 new InitEntry(i2.constInit, i1.bar), |
| 276 new InitEntry(i2.constInit, i1.Bar), | 276 new InitEntry(i2.constInit, i1.Bar), |
| 277 ]); | 277 ]); |
| 278 | 278 |
| 279 i0.main(); | 279 i0.main(); |
| 280 } | 280 } |
| 281 ''') | 281 ''') |
| 282 }, []); | 282 }, []); |
| 283 } | 283 } |
| 284 | 284 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 initializers.addAll([ | 336 initializers.addAll([ |
| 337 new InitEntry(i2.initMethod, i1.foo), | 337 new InitEntry(i2.initMethod, i1.foo), |
| 338 new InitEntry(i2.initMethod, i0.index), | 338 new InitEntry(i2.initMethod, i0.index), |
| 339 ]); | 339 ]); |
| 340 | 340 |
| 341 i0.main(); | 341 i0.main(); |
| 342 } | 342 } |
| 343 ''') | 343 ''') |
| 344 }, []); | 344 }, []); |
| 345 } | 345 } |
| OLD | NEW |