Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_ast_test.dart

Issue 2527453002: Respect the "allowErrors" parameter in _ResynthesizeAstTest.checkLibrary. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698