| 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 00107ff0821cf23330c7ef444d42bc46e188543c..2ad25036ce06f5ac07732dcc86a5953f7c08add2 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/CompilerTestCase.java
|
| @@ -240,13 +240,17 @@ public abstract class CompilerTestCase extends TestCase {
|
| /**
|
| * Parse a single compilation unit for the name and source.
|
| */
|
| - protected DartUnit parseUnit(String srcName, String sourceCode) {
|
| + protected DartUnit parseUnit(String srcName, String sourceCode, Object... errors) {
|
| // TODO(jgw): We'll need to fill in the library parameter when testing multiple units.
|
| DartSourceTest src = new DartSourceTest(srcName, sourceCode, null);
|
| - ParserContext context = makeParserContext(src, sourceCode, DartCompilerListener.EMPTY);
|
| - return makeParser(context).parseUnit(src);
|
| + DartCompilerListenerTest listener = new DartCompilerListenerTest(srcName, errors);
|
| + ParserContext context = makeParserContext(src, sourceCode, listener);
|
| + DartUnit unit = makeParser(context).parseUnit(src);
|
| + listener.checkAllErrorsReported();
|
| + return unit;
|
| }
|
|
|
| +
|
| /**
|
| * Parse a single compilation unit with given name and source, and check for a set of expected errors.
|
| *
|
|
|