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

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

Issue 11364211: Type quality of ArrayAccess is same as quality of target type. (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 a3cbffabc9886804614c802486feca5bb38d6db7..92247b15651447633a69246c4e9538f7831e6ebd 100644
--- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
@@ -459,16 +459,27 @@ public abstract class CompilerTestCase extends TestCase {
/**
* Asserts that {@link Element} with given name has expected type.
*/
- protected static void assertInferredElementTypeString(DartUnit unit, String variableName,
- String expectedType, TypeQuality exact) {
+ protected static void assertInferredElementTypeString(
+ DartUnit unit,
+ String variableName,
+ String expectedType,
+ TypeQuality quality) {
// find element
Element element = getNamedElement(unit, variableName);
assertNotNull(element);
// check type
Type actualType = element.getType();
- assertEquals(element.getName(), expectedType, getTypeSource(actualType));
- if (exact != null) {
- assertSame(exact, actualType.getQuality());
+ assertInferredElementTypeString(actualType, element.getName(), expectedType, quality);
+ }
+
+ protected static void assertInferredElementTypeString(
+ Type actualType,
+ String testName,
+ String expectedType,
+ TypeQuality quality) {
+ assertEquals(testName, expectedType, getTypeSource(actualType));
+ if (quality != null) {
+ assertSame(quality, actualType.getQuality());
}
}

Powered by Google App Engine
This is Rietveld 408576698