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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java

Issue 11029037: Fix for cascade sections SourceInfo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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: compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java
index c326c6c0fa6ae7d0463611ae6944433d29d86565..50a93b2661357d5ac80c8f34295e92d0dcd0e7e7 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java
@@ -229,7 +229,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
"}"));
assertErrors(libraryResult.getCompilationErrors());
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
- DartNewExpression newExpression = findExpression(unit, "new F()");
+ DartNewExpression newExpression = findNodeBySource(unit, "new F()");
ConstructorElement constructorElement = newExpression.getElement();
assertNotNull(constructorElement);
assertEquals("", getElementSource(constructorElement));
@@ -250,7 +250,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
libraryResult.getErrors(),
errEx(ResolverErrorCode.NEW_EXPRESSION_NOT_CONSTRUCTOR, 5, 11, 3));
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
- DartNewExpression newExpression = findExpression(unit, "new A.foo()");
+ DartNewExpression newExpression = findNodeBySource(unit, "new A.foo()");
ConstructorElement constructorElement = newExpression.getElement();
assertNull(constructorElement);
}
@@ -306,7 +306,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
"}"));
assertErrors(libraryResult.getCompilationErrors());
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
- DartNewExpression newExpression = findExpression(unit, "new I()");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I()");
ConstructorElement constructorElement = newExpression.getElement();
assertNotNull(constructorElement);
assertEquals("", getElementSource(constructorElement));
@@ -331,7 +331,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
"}"));
assertErrors(libraryResult.getCompilationErrors());
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
- DartNewExpression newExpression = findExpression(unit, "new I()");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I()");
ConstructorElement constructorElement = newExpression.getElement();
assertNotNull(constructorElement);
assertEquals("", getElementSource(constructorElement));
@@ -357,7 +357,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
"}"));
assertErrors(libraryResult.getCompilationErrors());
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
- DartNewExpression newExpression = findExpression(unit, "new I()");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I()");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("F()"));
}
@@ -419,7 +419,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
"}"));
assertErrors(libraryResult.getCompilationErrors());
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
- DartNewExpression newExpression = findExpression(unit, "new I(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I(0)");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("F(int y)"));
}
@@ -460,7 +460,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
// "new I.foo()" - good
{
- DartNewExpression newExpression = findExpression(unit, "new I.foo(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.foo(0)");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("F.foo(int y)"));
}
@@ -522,12 +522,12 @@ public class ResolverCompilerTest extends CompilerTestCase {
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
// "new I()" - no such constructor, has other constructors, so no implicit default.
{
- DartNewExpression newExpression = findExpression(unit, "new I(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I(0)");
assertEquals(null, newExpression.getElement());
}
// "new I.foo()" - would be valid, if not "F implements I", but here invalid
{
- DartNewExpression newExpression = findExpression(unit, "new I.foo(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.foo(0)");
assertEquals(null, newExpression.getElement());
}
}
@@ -570,13 +570,13 @@ public class ResolverCompilerTest extends CompilerTestCase {
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
// "new I()"
{
- DartNewExpression newExpression = findExpression(unit, "new I(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I(0)");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("I(int y)"));
}
// "new I.foo()"
{
- DartNewExpression newExpression = findExpression(unit, "new I.foo(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.foo(0)");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("I.foo(int y)"));
}
@@ -628,7 +628,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
// "new I.foo()"
{
- DartNewExpression newExpression = findExpression(unit, "new I.foo(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.foo(0)");
assertEquals(null, newExpression.getElement());
}
}
@@ -675,7 +675,7 @@ public class ResolverCompilerTest extends CompilerTestCase {
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
// "new I.foo()" - resolved, but we produce error.
{
- DartNewExpression newExpression = findExpression(unit, "new I.foo()");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.foo()");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("F.foo()"));
}
@@ -748,19 +748,19 @@ public class ResolverCompilerTest extends CompilerTestCase {
DartUnit unit = libraryResult.getLibraryUnitResult().getUnits().iterator().next();
// "new I.foo()" - resolved, but we produce error.
{
- DartNewExpression newExpression = findExpression(unit, "new I.foo(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.foo(0)");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("F.foo("));
}
// "new I.bar()" - resolved, but we produce error.
{
- DartNewExpression newExpression = findExpression(unit, "new I.bar(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.bar(0)");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("F.bar("));
}
// "new I.baz()" - resolved, but we produce error.
{
- DartNewExpression newExpression = findExpression(unit, "new I.baz(0)");
+ DartNewExpression newExpression = findNodeBySource(unit, "new I.baz(0)");
ConstructorElement constructorElement = newExpression.getElement();
assertEquals(true, getElementSource(constructorElement).contains("F.baz("));
}

Powered by Google App Engine
This is Rietveld 408576698