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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java

Issue 11377039: Issue 6251. Resolve and rename type and constructor references in [new Type.name]. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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/utilities/ast/DartElementLocatorTest.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java
index 6a133a063a5f7215ccc714eb80e23ebc2c3b24d8..3b5ed0b22376bbb275c260e38bdbc110d43453ea 100644
--- a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java
+++ b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DartElementLocatorTest.java
@@ -735,6 +735,36 @@ public class DartElementLocatorTest extends TestCase {
4);
}
+ public void test_newNameInComment_defaultConstructor() throws Exception {
+ String[] lines = formatLines(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "/** Create using [new A] constructor. */",
+ "class A {",
+ " A() {}",
+ " A.named() {}",
+ "}",
+ "");
+ testElementLocator(lines, "[new A]", Method.class, "A() {}", "A".length());
+ testElementLocator(lines, "new A]", Method.class, "A() {}", "A".length());
+ testElementLocator(lines, "] constructor", Method.class, "A() {}", "A".length());
+ testElementLocator(lines, " constructor", Method.class, "A() {}", "A".length());
+ }
+
+ public void test_newNameInComment_namedConstructor() throws Exception {
+ String[] lines = formatLines(
+ "// filler filler filler filler filler filler filler filler filler filler filler",
+ "/** Create using [new A.named] constructor. */",
+ "class A {",
+ " A() {}",
+ " A.named() {}",
+ "}",
+ "");
+ testElementLocator(lines, "[new A.named]", Method.class, "A.named() {}", "A.named".length());
+ testElementLocator(lines, "new A.named]", Method.class, "A.named() {}", "A.named".length());
+ testElementLocator(lines, "] constructor", Method.class, "A.named() {}", "A.named".length());
+ testElementLocator(lines, " constructor", Method.class, "A.named() {}", "A.named".length());
+ }
+
public void test_type_newExpression() throws Exception {
testElementLocator(
formatLines(

Powered by Google App Engine
This is Rietveld 408576698