| 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 f7dfe4b495c3cc142d8eeafd776316e69b9bd059..ca89628071d860791c0c1acab323b799acefdf7f 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| @@ -4,6 +4,8 @@
|
|
|
| package com.google.dart.compiler;
|
|
|
| +import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
|
| +
|
| import com.google.common.collect.Lists;
|
| import com.google.dart.compiler.CommandLineOptions.CompilerOptions;
|
| import com.google.dart.compiler.ast.DartInvocation;
|
| @@ -13,7 +15,6 @@ import com.google.dart.compiler.ast.DartNodeTraverser;
|
| import com.google.dart.compiler.ast.DartUnit;
|
| import com.google.dart.compiler.ast.LibraryUnit;
|
| import com.google.dart.compiler.common.ErrorExpectation;
|
| -import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
|
| import com.google.dart.compiler.parser.DartParser;
|
| import com.google.dart.compiler.parser.DartParserRunner;
|
| import com.google.dart.compiler.parser.DartScannerParserContext;
|
| @@ -306,6 +307,14 @@ public abstract class CompilerTestCase extends TestCase {
|
| }
|
|
|
| /**
|
| + * Parses given source and checks parsing problems.
|
| + */
|
| + protected final void parseExpectWarnings(String code, ErrorExpectation... expectedWarnings) {
|
| + DartParserRunner runner = DartParserRunner.parse(getName(), code, Integer.MAX_VALUE, true);
|
| + List<DartCompilationError> errors = runner.getErrors();
|
| + assertErrors(errors, expectedWarnings);
|
| + }
|
| + /**
|
| * @return the {@link DartInvocation} with given source. This is inaccurate approach, but good
|
| * enough for specific tests.
|
| */
|
|
|