| 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 | 4 |
| 5 library test.src.task.dart_test; | 5 library test.src.task.dart_test; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart'; | 7 import 'package:analyzer/file_system/file_system.dart'; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart'; | 8 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 expect(libraryElement.parts, | 529 expect(libraryElement.parts, |
| 530 unorderedEquals([partUnits[0].element, partUnits[1].element])); | 530 unorderedEquals([partUnits[0].element, partUnits[1].element])); |
| 531 // LibraryElement references | 531 // LibraryElement references |
| 532 expect((libraryUnit.directives[0] as LibraryDirective).element, | 532 expect((libraryUnit.directives[0] as LibraryDirective).element, |
| 533 same(libraryElement)); | 533 same(libraryElement)); |
| 534 expect((partUnits[0].directives[0] as PartOfDirective).element, | 534 expect((partUnits[0].directives[0] as PartOfDirective).element, |
| 535 same(libraryElement)); | 535 same(libraryElement)); |
| 536 expect((partUnits[1].directives[0] as PartOfDirective).element, | 536 expect((partUnits[1].directives[0] as PartOfDirective).element, |
| 537 same(libraryElement)); | 537 same(libraryElement)); |
| 538 // CompilationUnitElement(s) | 538 // CompilationUnitElement(s) |
| 539 { | 539 CompilationUnitElement firstPart; |
| 540 CompilationUnitElement unitElement = partUnits[0].element; | 540 CompilationUnitElement secondPart; |
| 541 expect(unitElement.uri, 'part1.dart'); | 541 if (partUnits[0].element.uri == 'part1.dart') { |
| 542 expect(unitElement.uriOffset, 18); | 542 firstPart = partUnits[0].element; |
| 543 expect(unitElement.uriEnd, 30); | 543 secondPart = partUnits[1].element; |
| 544 expect((libraryUnit.directives[1] as PartDirective).element, | 544 } else { |
| 545 same(unitElement)); | 545 firstPart = partUnits[1].element; |
| 546 secondPart = partUnits[0].element; |
| 546 } | 547 } |
| 547 { | 548 expect(firstPart.uri, 'part1.dart'); |
| 548 CompilationUnitElement unitElement = partUnits[1].element; | 549 expect(firstPart.uriOffset, 18); |
| 549 expect(unitElement.uri, 'part2.dart'); | 550 expect(firstPart.uriEnd, 30); |
| 550 expect(unitElement.uriOffset, 37); | 551 expect( |
| 551 expect(unitElement.uriEnd, 49); | 552 (libraryUnit.directives[1] as PartDirective).element, same(firstPart)); |
| 552 expect((libraryUnit.directives[2] as PartDirective).element, | 553 |
| 553 same(unitElement)); | 554 expect(secondPart.uri, 'part2.dart'); |
| 554 } | 555 expect(secondPart.uriOffset, 37); |
| 556 expect(secondPart.uriEnd, 49); |
| 557 expect( |
| 558 (libraryUnit.directives[2] as PartDirective).element, same(secondPart)); |
| 555 } | 559 } |
| 556 | 560 |
| 557 test_perform_error_missingLibraryDirectiveWithPart_hasCommon() { | 561 test_perform_error_missingLibraryDirectiveWithPart_hasCommon() { |
| 558 _performBuildTask({ | 562 _performBuildTask({ |
| 559 '/lib.dart': ''' | 563 '/lib.dart': ''' |
| 560 part 'partA.dart'; | 564 part 'partA.dart'; |
| 561 part 'partB.dart'; | 565 part 'partB.dart'; |
| 562 ''', | 566 ''', |
| 563 '/partA.dart': ''' | 567 '/partA.dart': ''' |
| 564 part of my_lib; | 568 part of my_lib; |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 return entryMap.putIfAbsent(target, () => new CacheEntry()); | 1017 return entryMap.putIfAbsent(target, () => new CacheEntry()); |
| 1014 } | 1018 } |
| 1015 | 1019 |
| 1016 TimestampedData<String> getContents(Source source) => source.contents; | 1020 TimestampedData<String> getContents(Source source) => source.contents; |
| 1017 | 1021 |
| 1018 noSuchMethod(Invocation invocation) { | 1022 noSuchMethod(Invocation invocation) { |
| 1019 print('noSuchMethod: ${invocation.memberName}'); | 1023 print('noSuchMethod: ${invocation.memberName}'); |
| 1020 return super.noSuchMethod(invocation); | 1024 return super.noSuchMethod(invocation); |
| 1021 } | 1025 } |
| 1022 } | 1026 } |
| OLD | NEW |