| Index: tests/compiler/dart2js/analyze_all_test.dart
|
| diff --git a/tests/compiler/dart2js/analyze_all_test.dart b/tests/compiler/dart2js/analyze_all_test.dart
|
| index caab884c163064c4f7686e6666b77da77f6d618b..2bb4808ee60e3ba4f0ae3c25474233fc8a0cdc43 100644
|
| --- a/tests/compiler/dart2js/analyze_all_test.dart
|
| +++ b/tests/compiler/dart2js/analyze_all_test.dart
|
| @@ -31,26 +31,28 @@ main() {
|
| Uri uri = Uri.parse('test:code');
|
| var compiler1 = compilerFor(SOURCE, uri, analyzeAll: false);
|
| asyncTest(() => compiler1.run(uri).then((compilationSucceded) {
|
| + DiagnosticCollector collector = compiler1.diagnosticCollector;
|
| Expect.isTrue(compilationSucceded);
|
| - print(compiler1.warnings);
|
| - Expect.isTrue(compiler1.warnings.isEmpty, 'unexpected warnings');
|
| - Expect.isTrue(compiler1.errors.isEmpty, 'unexpected errors');
|
| + print(collector.warnings);
|
| + Expect.isTrue(collector.warnings.isEmpty, 'unexpected warnings');
|
| + Expect.isTrue(collector.errors.isEmpty, 'unexpected errors');
|
| }));
|
|
|
| var compiler2 = compilerFor(SOURCE, uri, analyzeAll: true);
|
| asyncTest(() => compiler2.run(uri).then((compilationSucceded) {
|
| + DiagnosticCollector collector = compiler2.diagnosticCollector;
|
| Expect.isFalse(compilationSucceded);
|
| - Expect.isTrue(compiler2.warnings.isEmpty,
|
| - 'unexpected warnings: ${compiler2.warnings}');
|
| - Expect.equals(2, compiler2.errors.length,
|
| - 'expected exactly two errors, but got ${compiler2.errors}');
|
| -
|
| - Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
|
| - compiler2.errors[0].message.kind);
|
| - Expect.equals("Foo", compiler2.errors[0].node.toString());
|
| -
|
| - Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
|
| - compiler2.errors[1].message.kind);
|
| - Expect.equals("Foo", compiler2.errors[1].node.toString());
|
| + Expect.isTrue(collector.warnings.isEmpty,
|
| + 'unexpected warnings: ${collector.warnings}');
|
| + Expect.equals(2, collector.errors.length,
|
| + 'expected exactly two errors, but got ${collector.errors}');
|
| +
|
| + CollectedMessage first = collector.errors.first;
|
| + Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, first.message.kind);
|
| + Expect.equals("Foo", SOURCE.substring(first.begin, first.end));
|
| +
|
| + CollectedMessage second = collector.errors.elementAt(1);
|
| + Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, second.message.kind);
|
| + Expect.equals("Foo", SOURCE.substring(second.begin, second.end));
|
| }));
|
| }
|
|
|