| Index: tests/compiler/dart2js/type_test_helper.dart
|
| diff --git a/tests/compiler/dart2js/type_test_helper.dart b/tests/compiler/dart2js/type_test_helper.dart
|
| index d6168355375e84a827c207afba9b4f7a69eb7f1a..01e8c16fad5869ffd0075d015e758555509aa74a 100644
|
| --- a/tests/compiler/dart2js/type_test_helper.dart
|
| +++ b/tests/compiler/dart2js/type_test_helper.dart
|
| @@ -22,7 +22,9 @@ GenericType instantiate(TypeDeclarationElement element,
|
| class TypeEnvironment {
|
| final MockCompiler compiler;
|
|
|
| - static Future<TypeEnvironment> create(String source) {
|
| + static Future<TypeEnvironment> create(
|
| + String source, {bool expectNoErrors: false,
|
| + bool expectNoWarningsOrErrors: false}) {
|
| var uri = new Uri(scheme: 'source');
|
| MockCompiler compiler = compilerFor('''
|
| main() {}
|
| @@ -31,6 +33,14 @@ class TypeEnvironment {
|
| analyzeAll: true,
|
| analyzeOnly: true);
|
| return compiler.runCompiler(uri).then((_) {
|
| + if (expectNoErrors || expectNoWarningsOrErrors) {
|
| + Expect.isTrue(compiler.errors.isEmpty,
|
| + 'Unexpected errors: ${compiler.errors}');
|
| + }
|
| + if (expectNoWarningsOrErrors) {
|
| + Expect.isTrue(compiler.warnings.isEmpty,
|
| + 'Unexpected warnings: ${compiler.warnings}');
|
| + }
|
| return new TypeEnvironment._(compiler);
|
| });
|
| }
|
|
|