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

Unified Diff: editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTests.java

Issue 606753003: Implement strict and non-strict union types in completion UI. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Factor out mapping of [getName] over elements per @brianwilkerson. Created 6 years, 3 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
Index: editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTests.java
diff --git a/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTests.java b/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTests.java
index cf16a800cd957884b20c711eb483b8f159496424..cd07d9c113e939a53f783867493be9920de825a5 100644
--- a/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTests.java
+++ b/editor/tools/plugins/com.google.dart.engine.services_test/src/com/google/dart/engine/services/completion/CompletionTests.java
@@ -1817,11 +1817,11 @@ public class CompletionTests extends CompletionTestCase {
test("topValue = 7; class Foo { mth() { if (t!1) {}}}", "1+topValue");
}
- public void testCompletion_ifStmt_unionType() throws Exception {
+ public void testCompletion_ifStmt_unionType_nonStrict() throws Exception {
enableUnionTypes(false);
test(src(//
- "class A { a() => null; }",
- "class B { b() => null; }",
+ "class A { a() => null; x() => null}",
+ "class B { a() => null; y() => null}",
"void main() {",
" var x;",
" var c;",
@@ -1831,7 +1831,24 @@ public class CompletionTests extends CompletionTestCase {
" x = new B();",
" }",
" x.!1;",
- "}"), "1+a", "1+b");
+ "}"), "1+a", "1+x", "1+y");
+ }
+
+ public void testCompletion_ifStmt_unionType_strict() throws Exception {
+ enableUnionTypes(true);
+ test(src(//
+ "class A { a() => null; x() => null}",
+ "class B { a() => null; y() => null}",
+ "void main() {",
+ " var x;",
+ " var c;",
+ " if(c) {",
+ " x = new A();",
+ " } else {",
+ " x = new B();",
+ " }",
+ " x.!1;",
+ "}"), "1+a", "1-x", "1-y");
}
public void testCompletion_import() throws Exception {
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine.services/src/com/google/dart/engine/services/completion/CompletionEngine.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698