| Index: compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| index e5388c611393728f65e4573b042028a5d6fbe3f1..2dacfb07ab924c25d8f143f3dd8f171b0c8252ac 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| @@ -24,6 +24,7 @@ import com.google.dart.compiler.parser.DartParserRunner;
|
| import com.google.dart.compiler.resolver.Element;
|
| import com.google.dart.compiler.type.Type;
|
| import com.google.dart.compiler.type.TypeKind;
|
| +import com.google.dart.compiler.util.apache.StringUtils;
|
|
|
| import junit.framework.TestCase;
|
|
|
| @@ -433,7 +434,7 @@ public abstract class CompilerTestCase extends TestCase {
|
| assertNotNull(element);
|
| // check type
|
| Type actualType = element.getType();
|
| - assertEquals(element.getName(), expectedType, actualType.toString());
|
| + assertEquals(element.getName(), expectedType, getTypeSource(actualType));
|
| // should be inferred
|
| if (TypeKind.of(actualType) != TypeKind.DYNAMIC) {
|
| assertTrue("Should be marked as inferred", actualType.isInferred());
|
| @@ -441,6 +442,15 @@ public abstract class CompilerTestCase extends TestCase {
|
| }
|
|
|
| /**
|
| + * @return the source-like {@link String} for the given {@link Type}.
|
| + */
|
| + protected static String getTypeSource(Type actualType) {
|
| + String source = actualType.toString();
|
| + source = StringUtils.replace(source, "<dynamic>", "Dynamic");
|
| + return source;
|
| + }
|
| +
|
| + /**
|
| * @return the {@link Element} with given name, may be <code>null</code>.
|
| */
|
| private static Element getNamedElement(DartUnit unit, final String name) {
|
|
|