Index: pkg/analyzer/test/src/summary/resynthesize_ast_test.dart |
diff --git a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart |
index 276a842b53d719586792de350b4704a397abab32..62affda222131fdcbae080078962f7e681932ce9 100644 |
--- a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart |
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart |
@@ -6,6 +6,7 @@ library analyzer.test.src.summary.resynthesize_ast_test; |
import 'package:analyzer/dart/ast/ast.dart'; |
import 'package:analyzer/dart/element/element.dart'; |
+import 'package:analyzer/error/error.dart'; |
import 'package:analyzer/src/dart/element/element.dart'; |
import 'package:analyzer/src/generated/engine.dart' |
show AnalysisContext, AnalysisOptionsImpl; |
@@ -881,6 +882,12 @@ abstract class _ResynthesizeAstTest extends ResynthesizeTest |
Source source = addTestSource(text); |
LibraryElementImpl resynthesized = _encodeDecodeLibraryElement(source); |
LibraryElementImpl original = context.computeLibraryElement(source); |
+ if (!allowErrors) { |
+ List<AnalysisError> errors = context.computeErrors(source); |
+ if (errors.isNotEmpty) { |
+ fail('Analysis errors: $errors'); |
+ } |
+ } |
checkLibraryElements(original, resynthesized); |
return resynthesized; |
} |