Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart

Issue 2728653004: Default arg support continued (flutter-intellij#553). (Closed)
Patch Set: Review tweaks. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
diff --git a/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
index 9801e821e63857733549e98ed9191f541af06ddd..2dbbc0506bd1732296a17392cf53fc774305f821 100644
--- a/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
@@ -4163,4 +4163,59 @@ class C1 extends C2 implements C3 {
class TypeMemberContributorTest_Driver extends TypeMemberContributorTest {
@override
bool get enableNewAnalysisDriver => true;
+
+ test_ArgDefaults_method() async {
+ addTestSource('''
+class A {
+ bool a(int b, bool c) => false;
+}
+
+void main() {new A().a^}''');
+ await computeSuggestions();
+
+ assertSuggestMethod('a', 'A', 'bool', defaultArgListString: 'b, c');
+ }
+
+ test_ArgDefaults_method_none() async {
+ addTestSource('''
+class A {
+ bool a() => false;
+}
+
+void main() {new A().a^}''');
+ await computeSuggestions();
+
+ assertSuggestMethod('a', 'A', 'bool', defaultArgListString: null);
+ }
+
+ test_ArgDefaults_method_with_optional_positional() async {
+ addMetaPackageSource();
+ addTestSource('''
+import 'package:meta/meta.dart';
+
+class A {
+ bool foo(int bar, [bool boo, int baz]) => false;
+}
+
+void main() {new A().f^}''');
+ await computeSuggestions();
+
+ assertSuggestMethod('foo', 'A', 'bool', defaultArgListString: 'bar');
+ }
+
+ test_ArgDefaults_method_with_required_named() async {
+ addMetaPackageSource();
+ addTestSource('''
+import 'package:meta/meta.dart';
+
+class A {
+ bool foo(int bar, {bool boo, @required int baz}) => false;
+}
+
+void main() {new A().f^}''');
+ await computeSuggestions();
+
+ assertSuggestMethod('foo', 'A', 'bool',
+ defaultArgListString: 'bar, baz: null');
+ }
}
« no previous file with comments | « pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698