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

Unified Diff: compiler/javatests/com/google/dart/compiler/CompilerTestCase.java

Issue 11293058: Issue 5157. Introduce TypeQuality. Try to find member in subclasses. (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: 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 9a1cae7321c65bc893e159b4a0e05ea8c14df256..a3cbffabc9886804614c802486feca5bb38d6db7 100644
--- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
@@ -4,8 +4,6 @@
package com.google.dart.compiler;
-import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
-
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -24,7 +22,9 @@ import com.google.dart.compiler.parser.DartParser;
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.type.TypeQuality;
+
+import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
import junit.framework.TestCase;
@@ -456,23 +456,19 @@ public abstract class CompilerTestCase extends TestCase {
assertEquals(nodeSource, actualSource);
}
-
/**
* Asserts that {@link Element} with given name has expected type.
*/
- protected static void assertInferredElementTypeString(
- DartUnit unit,
- String variableName,
- String expectedType) {
+ protected static void assertInferredElementTypeString(DartUnit unit, String variableName,
+ String expectedType, TypeQuality exact) {
// find element
Element element = getNamedElement(unit, variableName);
assertNotNull(element);
// check type
Type actualType = element.getType();
assertEquals(element.getName(), expectedType, getTypeSource(actualType));
- // should be inferred
- if (TypeKind.of(actualType) != TypeKind.DYNAMIC) {
- assertTrue("Should be marked as inferred", actualType.isInferred());
+ if (exact != null) {
+ assertSame(exact, actualType.getQuality());
}
}

Powered by Google App Engine
This is Rietveld 408576698