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

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

Issue 999923002: completions for function return type (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 9 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/completion_test_util.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/optype_test.dart
diff --git a/pkg/analysis_server/test/services/completion/optype_test.dart b/pkg/analysis_server/test/services/completion/optype_test.dart
index 8eeacac9a8357ffd78a37c71d10d5d68b36bda62..9ff44e53a86c996f4869b3c580db4a9fc40db88f 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -502,6 +502,155 @@ class OpTypeTest {
assertOpType(returnValue: true, typeNames: true);
}
+ test_FunctionDeclaration1() {
+ // SimpleIdentifier FunctionDeclaration CompilationUnit
+ addTestSource('const ^Fara();');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration2() {
+ // SimpleIdentifier FunctionDeclaration CompilationUnit
+ addTestSource('const F^ara();');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_inLineComment() {
+ // Comment CompilationUnit
+ addTestSource('''
+ // normal comment ^
+ zoo(z) { } String name;''');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inLineComment2() {
+ // Comment CompilationUnit
+ addTestSource('''
+ // normal ^comment
+ zoo(z) { } String name;''');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inLineComment3() {
+ // Comment CompilationUnit
+ addTestSource('''
+ // normal comment ^
+ // normal comment 2
+ zoo(z) { } String name;''');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inLineComment4() {
+ // Comment CompilationUnit
+ addTestSource('''
+ // normal comment
+ // normal comment 2^
+ zoo(z) { } String name;''');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inLineDocComment() {
+ // Comment FunctionDeclaration CompilationUnit
+ addTestSource('''
+ /// some dartdoc ^
+ zoo(z) { } String name;''');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inLineDocComment2() {
+ // Comment FunctionDeclaration CompilationUnit
+ addTestSource('''
+ /// some ^dartdoc
+ zoo(z) { } String name;''');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inStarComment() {
+ // Comment CompilationUnit
+ addTestSource('/* ^ */ zoo(z) {} String name;');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inStarComment2() {
+ // Comment CompilationUnit
+ addTestSource('/* *^/ zoo(z) {} String name;');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inStarDocComment() {
+ // Comment FunctionDeclaration CompilationUnit
+ addTestSource('/** ^ */ zoo(z) { } String name; ');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_inStarDocComment2() {
+ // Comment FunctionDeclaration CompilationUnit
+ addTestSource('/** *^/ zoo(z) { } String name;');
+ assertOpType();
+ }
+
+ test_FunctionDeclaration_returnType() {
+ // CompilationUnit
+ addTestSource('^ zoo(z) { } String name;');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterLineComment() {
+ // FunctionDeclaration CompilationUnit
+ addTestSource('''
+ // normal comment
+ ^ zoo(z) {} String name;''');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterLineComment2() {
+ // FunctionDeclaration CompilationUnit
+ // TOD(danrubel) left align all test source
+ addTestSource('''
+// normal comment
+^ zoo(z) {} String name;''');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterLineDocComment() {
+ // SimpleIdentifier FunctionDeclaration CompilationUnit
+ addTestSource('''
+ /// some dartdoc
+ ^ zoo(z) { } String name;''');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterLineDocComment2() {
+ // SimpleIdentifier FunctionDeclaration CompilationUnit
+ addTestSource('''
+/// some dartdoc
+^ zoo(z) { } String name;''');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterStarComment() {
+ // CompilationUnit
+ addTestSource('/* */ ^ zoo(z) { } String name;');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterStarComment2() {
+ // CompilationUnit
+ addTestSource('/* */^ zoo(z) { } String name;');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterStarDocComment() {
+ // FunctionDeclaration CompilationUnit
+ addTestSource('/** */ ^ zoo(z) { } String name;');
+ assertOpType(typeNames: true);
+ }
+
+ test_FunctionDeclaration_returnType_afterStarDocComment2() {
+ // FunctionDeclaration CompilationUnit
+ addTestSource('/** */^ zoo(z) { } String name;');
+ assertOpType(typeNames: true);
+ }
+
test_FunctionTypeAlias() {
// SimpleIdentifier FunctionTypeAlias CompilationUnit
addTestSource('typedef n^ ;');
« no previous file with comments | « pkg/analysis_server/test/services/completion/completion_test_util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698