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.services.completion.contributor.dart.inherited_ref; | 5 library test.services.completion.contributor.dart.inherited_ref; |
6 | 6 |
7 import 'package:analysis_server/src/protocol_server.dart'; | 7 import 'package:analysis_server/src/protocol_server.dart'; |
8 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 8 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
9 import 'package:analysis_server/src/services/completion/dart/inherited_reference
_contributor.dart'; | 9 import 'package:analysis_server/src/services/completion/dart/inherited_reference
_contributor.dart'; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 assertNotSuggested('y1'); | 616 assertNotSuggested('y1'); |
617 assertNotSuggested('x2'); | 617 assertNotSuggested('x2'); |
618 assertNotSuggested('y2'); | 618 assertNotSuggested('y2'); |
619 } | 619 } |
620 } | 620 } |
621 | 621 |
622 @reflectiveTest | 622 @reflectiveTest |
623 class InheritedContributorTest_Driver extends InheritedContributorTest { | 623 class InheritedContributorTest_Driver extends InheritedContributorTest { |
624 @override | 624 @override |
625 bool get enableNewAnalysisDriver => true; | 625 bool get enableNewAnalysisDriver => true; |
| 626 |
| 627 /// Sanity check. Permutations tested in local_ref_contributor. |
| 628 test_ArgDefaults_inherited_method_with_required_named() async { |
| 629 addMetaPackageSource(); |
| 630 resolveSource( |
| 631 '/testB.dart', |
| 632 ''' |
| 633 import 'package:meta/meta.dart'; |
| 634 |
| 635 lib libB; |
| 636 class A { |
| 637 bool foo(int bar, {bool boo, @required int baz}) => false; |
| 638 }'''); |
| 639 addTestSource(''' |
| 640 import "/testB.dart"; |
| 641 class B extends A { |
| 642 b() => f^ |
626 } | 643 } |
| 644 '''); |
| 645 await computeSuggestions(); |
| 646 |
| 647 assertSuggestMethod('foo', 'A', 'bool', |
| 648 defaultArgListString: 'bar, baz: null'); |
| 649 } |
| 650 } |
OLD | NEW |