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

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

Issue 10827469: Issue 4641. Resolve 'part of' to LibraryElement (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | « editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a838a55b8fba0c1585180b096a47a4a62d73ae35..c55b07dda8e78807771dd51e2a93b1d7f47bfbb8 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
@@ -13,6 +13,8 @@
*/
package com.google.dart.tools.core.utilities.ast;
+import static org.fest.assertions.Assertions.assertThat;
+
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.dart.compiler.DartCompilationError;
@@ -34,8 +36,6 @@ import junit.framework.TestCase;
import org.eclipse.core.resources.IResource;
-import static org.fest.assertions.Assertions.assertThat;
-
import java.util.List;
/**
@@ -404,6 +404,41 @@ public class DartElementLocatorTest extends TestCase {
4);
}
+ // XXX
+ public void test_LibraryUnit_onPartOf() throws Exception {
+ TestProject testProject = new TestProject("Test");
+ try {
+ IResource libResourceA = testProject.setUnitContent(
+ "Lib.dart",
+ Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "library my.lib;",
+ "part 'Test.dart';",
+ "")).getResource();
+ testProject.setUnitContent(
+ "Test.dart",
+ Joiner.on("\n").join(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "part of my.lib;",
+ ""));
+ TestProject.waitForAutoBuild();
+ DartLibrary library = testProject.getDartProject().getDartLibrary(libResourceA);
+ CompilationUnit testUnit = library.getCompilationUnit("Test.dart");
+ // usage of "aaa" = "libraryA"
+ {
+ DartElement element = assertLocation(
+ testUnit,
+ "my.lib",
+ CompilationUnit.class,
+ "library my.lib);",
+ 0);
+ assertSame(library.getDefiningCompilationUnit(), element);
+ }
+ } finally {
+ testProject.dispose();
+ }
+ }
+
public void test_Method_call() throws Exception {
testElementLocator(
formatLines(
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/ast/DartElementLocator.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698