| 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 /// End-to-end test of the analyzer2dart compiler. | 5 /// End-to-end test of the analyzer2dart compiler. |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'mock_sdk.dart'; | 9 import 'mock_sdk.dart'; |
| 10 import 'package:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 bar(a); | 303 bar(a); |
| 304 } | 304 } |
| 305 | 305 |
| 306 main() $NEW_BACKEND_COMMENT | 306 main() $NEW_BACKEND_COMMENT |
| 307 { | 307 { |
| 308 foo(null); | 308 foo(null); |
| 309 } | 309 } |
| 310 | 310 |
| 311 '''); | 311 '''); |
| 312 }); | 312 }); |
| 313 |
| 314 test('Top level field access', () { |
| 315 checkResult(''' |
| 316 main(args) { |
| 317 return deprecated; |
| 318 } |
| 319 ''', ''' |
| 320 main(args) $NEW_BACKEND_COMMENT |
| 321 { |
| 322 return deprecated; |
| 323 } |
| 324 |
| 325 '''); |
| 326 }); |
| 313 } | 327 } |
| 314 | 328 |
| 315 checkResult(String input, String expectedOutput) { | 329 checkResult(String input, String expectedOutput) { |
| 316 CollectingOutputProvider outputProvider = new CollectingOutputProvider(); | 330 CollectingOutputProvider outputProvider = new CollectingOutputProvider(); |
| 317 MemoryResourceProvider provider = new MemoryResourceProvider(); | 331 MemoryResourceProvider provider = new MemoryResourceProvider(); |
| 318 DartSdk sdk = new MockSdk(); | 332 DartSdk sdk = new MockSdk(); |
| 319 Driver driver = new Driver(provider, sdk, outputProvider); | 333 Driver driver = new Driver(provider, sdk, outputProvider); |
| 320 String rootFile = '/root.dart'; | 334 String rootFile = '/root.dart'; |
| 321 provider.newFile(rootFile, input); | 335 provider.newFile(rootFile, input); |
| 322 Source rootSource = driver.setRoot(rootFile); | 336 Source rootSource = driver.setRoot(rootFile); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 343 sb.write(text); | 357 sb.write(text); |
| 344 } | 358 } |
| 345 | 359 |
| 346 void addError(errorEvent, [StackTrace stackTrace]) {} | 360 void addError(errorEvent, [StackTrace stackTrace]) {} |
| 347 | 361 |
| 348 void close() {} | 362 void close() {} |
| 349 | 363 |
| 350 String get text => sb.toString(); | 364 String get text => sb.toString(); |
| 351 } | 365 } |
| 352 | 366 |
| OLD | NEW |