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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantVisitorTest.java

Issue 273703003: Don't generate errors when failing to follow const constructor redirections. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantVisitorTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantVisitorTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantVisitorTest.java
index 14e511e6f0b5efd973cadbfc19d8e8c4138eda6a..8aeab4456fda789127b5586c5af81db4037ec64e 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantVisitorTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantVisitorTest.java
@@ -141,7 +141,7 @@ public class ConstantVisitorTest extends ResolverTestCase {
" const factory A() = A.b;",
" const factory A.b() = A;",
"}"));
- assertError(evaluateConstant(compilationUnit, "foo"));
+ assertValidUnknown(evaluateConstant(compilationUnit, "foo"));
}
public void test_visitInstanceCreationExpression_redirect_extern() throws Exception {
@@ -150,7 +150,7 @@ public class ConstantVisitorTest extends ResolverTestCase {
"class A {",
" external const factory A();",
"}"));
- assertError(evaluateConstant(compilationUnit, "foo"));
+ assertValidUnknown(evaluateConstant(compilationUnit, "foo"));
}
public void test_visitInstanceCreationExpression_redirect_nonConst() throws Exception {
@@ -163,7 +163,7 @@ public class ConstantVisitorTest extends ResolverTestCase {
" const factory A() = A.b;",
" A.b();",
"}"));
- assertError(evaluateConstant(compilationUnit, "foo"));
+ assertValidUnknown(evaluateConstant(compilationUnit, "foo"));
}
public void test_visitInstanceCreationExpression_symbol() throws Exception {
@@ -175,16 +175,18 @@ public class ConstantVisitorTest extends ResolverTestCase {
assertEquals("a", value.getValue());
}
- private void assertError(EvaluationResultImpl result) {
- assertInstanceOf(ErrorResult.class, result);
- }
-
private void assertType(EvaluationResultImpl result, String typeName) {
assertInstanceOf(ValidResult.class, result);
DartObjectImpl value = ((ValidResult) result).getValue();
assertEquals(typeName, value.getType().getName());
}
+ private void assertValidUnknown(EvaluationResultImpl result) {
+ assertInstanceOf(ValidResult.class, result);
+ DartObjectImpl value = ((ValidResult) result).getValue();
+ assertTrue(value.isUnknown());
+ }
+
private void assertValue(long expectedValue, EvaluationResultImpl result) {
assertInstanceOf(ValidResult.class, result);
DartObjectImpl value = ((ValidResult) result).getValue();

Powered by Google App Engine
This is Rietveld 408576698