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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java

Issue 8395013: DartC User Warning Framework (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use new ErrorCode enums in single onError() method. Created 9 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/type/TypeTestCase.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java b/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java
index 61eaa74e60aa7d57d81527be1fb93557259cc0e1..fe9c9419581cbb7ff87f7a155a4cc06954e4981b 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java
@@ -7,6 +7,7 @@ package com.google.dart.compiler.type;
import com.google.dart.compiler.DartCompilationError;
import com.google.dart.compiler.DartCompilerListener;
import com.google.dart.compiler.ErrorCode;
+import com.google.dart.compiler.SubSystem;
import com.google.dart.compiler.ast.DartUnit;
import com.google.dart.compiler.ast.DartBlock;
import com.google.dart.compiler.ast.DartFunction;
@@ -166,32 +167,23 @@ abstract class TypeTestCase extends TestCase {
final DartCompilerListener listener = new DartCompilerListener() {
@Override
- public void compilationError(DartCompilationError event) {
+ public void onError(DartCompilationError event) {
throw new AssertionError(event);
}
@Override
- public void compilationWarning(DartCompilationError event) {
- compilationError(event);
- }
-
- @Override
- public void typeError(DartCompilationError event) {
- compilationError(event);
- }
-
- @Override
public void unitCompiled(DartUnit unit) {
}
};
final TestCompilerContext context = new TestCompilerContext() {
- @Override
- public void typeError(DartCompilationError event) {
- getErrorCodes().add(event.getErrorCode());
- expectedTypeErrors--;
- if (expectedTypeErrors < 0) {
- throw new TestTypeError(event);
+ public void onError(DartCompilationError event) {
+ if (event.getErrorCode().getSubSystem() == SubSystem.STATIC_TYPE) {
+ getErrorCodes().add(event.getErrorCode());
+ expectedTypeErrors--;
+ if (expectedTypeErrors < 0) {
+ throw new TestTypeError(event);
+ }
}
}
};

Powered by Google App Engine
This is Rietveld 408576698