| 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 library test.analysis.notification.navigation; | 5 library test.analysis.notification.navigation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
| 10 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 test_string_part_unresolvedUri() { | 574 test_string_part_unresolvedUri() { |
| 575 addTestFile(''' | 575 addTestFile(''' |
| 576 library lib; | 576 library lib; |
| 577 part "test_unit.dart"; | 577 part "test_unit.dart"; |
| 578 '''); | 578 '''); |
| 579 return prepareNavigation().then((_) { | 579 return prepareNavigation().then((_) { |
| 580 assertNoRegionString('part "test_unit.dart"'); | 580 assertNoRegionString('part "test_unit.dart"'); |
| 581 }); | 581 }); |
| 582 } | 582 } |
| 583 | 583 |
| 584 test_superConstructorInvocation() { |
| 585 addTestFile(''' |
| 586 class A { |
| 587 A() {} |
| 588 A.named() {} |
| 589 } |
| 590 class B extends A { |
| 591 B() : super(); |
| 592 B.named() : super.named(); |
| 593 } |
| 594 '''); |
| 595 return prepareNavigation().then((_) { |
| 596 { |
| 597 assertHasRegionString('super'); |
| 598 assertHasTarget('A() {}', 0); |
| 599 } |
| 600 { |
| 601 assertHasRegionString('super.named'); |
| 602 assertHasTarget('named() {}'); |
| 603 } |
| 604 }); |
| 605 } |
| 606 |
| 607 test_superConstructorInvocation_synthetic() { |
| 608 addTestFile(''' |
| 609 class A { |
| 610 } |
| 611 class B extends A { |
| 612 B() : super(); |
| 613 } |
| 614 '''); |
| 615 return prepareNavigation().then((_) { |
| 616 { |
| 617 assertHasRegionString('super'); |
| 618 assertHasTarget('A {'); |
| 619 } |
| 620 }); |
| 621 } |
| 622 |
| 584 test_targetElement() { | 623 test_targetElement() { |
| 585 addTestFile(''' | 624 addTestFile(''' |
| 586 class AAA {} | 625 class AAA {} |
| 587 main() { | 626 main() { |
| 588 AAA aaa = null; | 627 AAA aaa = null; |
| 589 } | 628 } |
| 590 '''); | 629 '''); |
| 591 return prepareNavigation().then((_) { | 630 return prepareNavigation().then((_) { |
| 592 assertHasRegionTarget('AAA aaa', 'AAA {}'); | 631 assertHasRegionTarget('AAA aaa', 'AAA {}'); |
| 593 expect(testTarget.kind, ElementKind.CLASS); | 632 expect(testTarget.kind, ElementKind.CLASS); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 608 test_type_void() { | 647 test_type_void() { |
| 609 addTestFile(''' | 648 addTestFile(''' |
| 610 void main() { | 649 void main() { |
| 611 } | 650 } |
| 612 '''); | 651 '''); |
| 613 return prepareNavigation().then((_) { | 652 return prepareNavigation().then((_) { |
| 614 assertNoRegionAt('void'); | 653 assertNoRegionAt('void'); |
| 615 }); | 654 }); |
| 616 } | 655 } |
| 617 } | 656 } |
| OLD | NEW |