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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionEngineTest.java

Issue 9290015: Add type refinement to code completion as an experimental option. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionEngineTest.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionEngineTest.java (revision 3609)
+++ editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/completion/CompletionEngineTest.java (working copy)
@@ -13,6 +13,7 @@
*/
package com.google.dart.tools.core.internal.completion;
+import com.google.dart.tools.core.DartCoreDebug;
import com.google.dart.tools.core.model.DartModelException;
import junit.framework.TestCase;
@@ -175,6 +176,24 @@
"1-Map");
}
+ public void testCommentSnippets033() throws Exception {
+ if (DartCoreDebug.ENABLE_TYPE_REFINEMENT) {
+ test("t1() {var x;if (x is List) {x.!1add(3);}}", "1+add", "1+length");
+ }
+ }
+
+ public void testCommentSnippets034() throws Exception {
+ if (DartCoreDebug.ENABLE_TYPE_REFINEMENT) {
+ test("t2() {var q=[0],z=q.!1length;q.!2isEmpty();}", "1+length", "2+isEmpty");
+ }
+ }
+
+ public void testCommentSnippets035() throws Exception {
+ if (DartCoreDebug.ENABLE_TYPE_REFINEMENT) {
+ test("t3() {var x=new List(), y=x.!1length();x.!2isEmpty();}", "1+length", "2+isEmpty");
+ }
+ }
+
public void testCompletion_alias_field() throws Exception {
// fails because test framework does not set compilation unit
// tests cannot check completion of any type defined in the test

Powered by Google App Engine
This is Rietveld 408576698