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

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

Issue 904653004: fix code completion in conditional expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 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/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 5b009584c75a0ac80db76decba481e14305e0ee0..e1646440c071b00890a621615c4aaebfb74562d8 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -303,16 +303,35 @@ class OpTypeTest {
assertOpType(returnValue: true, typeNames: true, voidReturn: true);
}
- test_ConditionalExpression_empty() {
- // SimpleIdentifier PrefixIdentifier IfStatement
- addTestSource('class A {foo() {A a; if (^) something}}');
+
+ test_ConditionalExpression_partial_thenExpression() {
+ // SimpleIdentifier ConditionalExpression ReturnStatement
+ addTestSource('class C {foo(){var f; {var x;} return a ? T^}}');
assertOpType(returnValue: true, typeNames: true);
}
- test_ConditionalExpression_invocation() {
- // SimpleIdentifier PrefixIdentifier IfStatement
- addTestSource('main() {var a; if (a.^) something}');
- assertOpType(invocation: true);
+ test_ConditionalExpression_partial_thenExpression_empty() {
+ // SimpleIdentifier ConditionalExpression ReturnStatement
+ addTestSource('class C {foo(){var f; {var x;} return a ? ^}}');
+ assertOpType(returnValue: true, typeNames: true);
+ }
+
+ test_ConditionalExpression_elseExpression() {
+ // SimpleIdentifier ConditionalExpression ReturnStatement
+ addTestSource('class C {foo(){var f; {var x;} return a ? T1 : T^}}');
+ assertOpType(returnValue: true, typeNames: true);
+ }
+
+ test_ConditionalExpression_elseExpression_empty() {
+ // SimpleIdentifier ConditionalExpression ReturnStatement
+ addTestSource('class C {foo(){var f; {var x;} return a ? T1 : ^}}');
+ assertOpType(returnValue: true, typeNames: true);
+ }
+
+ test_ConditionalExpression_thenExpression() {
+ // SimpleIdentifier ConditionalExpression ReturnStatement
+ addTestSource('class C {foo(){var f; {var x;} return a ? T^ : c}}');
+ assertOpType(returnValue: true, typeNames: true);
}
test_ConstructorName() {
@@ -471,6 +490,18 @@ class OpTypeTest {
assertOpType(returnValue: true, typeNames: true);
}
+ test_IfStatement_empty() {
+ // SimpleIdentifier PrefixIdentifier IfStatement
+ addTestSource('class A {foo() {A a; if (^) something}}');
+ assertOpType(returnValue: true, typeNames: true);
+ }
+
+ test_IfStatement_invocation() {
+ // SimpleIdentifier PrefixIdentifier IfStatement
+ addTestSource('main() {var a; if (a.^) something}');
+ assertOpType(invocation: true);
+ }
+
test_ImplementsClause() {
// ImplementsClause ClassDeclaration
addTestSource('class x implements ^\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