| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'package:analyzer/src/summary/format.dart'; | 5 import 'package:analyzer/src/summary/format.dart'; |
| 6 import 'package:analyzer/src/summary/link.dart'; | 6 import 'package:analyzer/src/summary/link.dart'; |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 8 | 8 |
| 9 import '../../reflective_tests.dart'; | 9 import '../../reflective_tests.dart'; |
| 10 import 'summarize_ast_test.dart'; | 10 import 'summarize_ast_test.dart'; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 Map<String, LinkedLibraryBuilder> linkedLibraries = | 31 Map<String, LinkedLibraryBuilder> linkedLibraries = |
| 32 setupForLink(linkerInputs.linkedLibraries, linkerInputs.getUnit); | 32 setupForLink(linkerInputs.linkedLibraries, linkerInputs.getUnit); |
| 33 linker = new Linker(linkedLibraries, linkerInputs.getDependency, | 33 linker = new Linker(linkedLibraries, linkerInputs.getDependency, |
| 34 linkerInputs.getUnit, true); | 34 linkerInputs.getUnit, true); |
| 35 } | 35 } |
| 36 | 36 |
| 37 LibraryElementForLink getLibrary(String uri) { | 37 LibraryElementForLink getLibrary(String uri) { |
| 38 return linker.getLibrary(Uri.parse(uri)); | 38 return linker.getLibrary(Uri.parse(uri)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void test_baseClass_genericWithAccessor() { |
| 42 createLinker(''' |
| 43 class B<T> { |
| 44 int get i => null; |
| 45 } |
| 46 class C<U> extends B<U> { |
| 47 var j; |
| 48 } |
| 49 '''); |
| 50 LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri); |
| 51 library.libraryCycleForLink.ensureLinked(); |
| 52 // No assertions--just make sure it doesn't crash. |
| 53 } |
| 54 |
| 41 void test_baseClass_withPrivateField() { | 55 void test_baseClass_withPrivateField() { |
| 42 createLinker(''' | 56 createLinker(''' |
| 43 class B { | 57 class B { |
| 44 var _b; | 58 var _b; |
| 45 } | 59 } |
| 46 class C extends B { | 60 class C extends B { |
| 47 var c; | 61 var c; |
| 48 } | 62 } |
| 49 '''); | 63 '''); |
| 50 LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri); | 64 LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri); |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 addNamedSource('/b.dart', ''); | 419 addNamedSource('/b.dart', ''); |
| 406 createLinker('import "a.dart"; import "b.dart";'); | 420 createLinker('import "a.dart"; import "b.dart";'); |
| 407 LibraryElementForLink libA = getLibrary('file:///a.dart'); | 421 LibraryElementForLink libA = getLibrary('file:///a.dart'); |
| 408 LibraryElementForLink libB = getLibrary('file:///b.dart'); | 422 LibraryElementForLink libB = getLibrary('file:///b.dart'); |
| 409 LibraryCycleForLink libraryCycle = testLibrary.libraryCycleForLink; | 423 LibraryCycleForLink libraryCycle = testLibrary.libraryCycleForLink; |
| 410 expect(libraryCycle.dependencies, | 424 expect(libraryCycle.dependencies, |
| 411 unorderedEquals([libA.libraryCycleForLink, libB.libraryCycleForLink])); | 425 unorderedEquals([libA.libraryCycleForLink, libB.libraryCycleForLink])); |
| 412 expect(libraryCycle.libraries, [testLibrary]); | 426 expect(libraryCycle.libraries, [testLibrary]); |
| 413 } | 427 } |
| 414 } | 428 } |
| OLD | NEW |