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

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

Issue 2728883004: Verify resynthesized elements by comparing text presentations. (Closed)
Patch Set: Final changes. Created 3 years, 10 months 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 5efc290a0226eb3ba864f80da05b1ec645b2cb51..139a5537d84a273e65e6b9491c1e49a682dc4868 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
@@ -29,6 +29,7 @@ import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../context/abstract_context.dart';
import '../task/strong/inferred_type_test.dart';
+import 'element_text.dart';
import 'resynthesize_common.dart';
import 'summary_common.dart';
@@ -37,13 +38,24 @@ main() {
defineReflectiveTests(ResynthesizeAstSpecTest);
defineReflectiveTests(ResynthesizeAstStrongTest);
defineReflectiveTests(AstInferredTypeTest);
+ defineReflectiveTests(ApplyCheckElementTextReplacements);
});
}
@reflectiveTest
+class ApplyCheckElementTextReplacements {
+ test_applyReplacements() {
+ applyCheckElementTextReplacements();
+ }
+}
+
+@reflectiveTest
class AstInferredTypeTest extends AbstractResynthesizeTest
with _AstResynthesizeTestMixin, InferredTypeMixin {
@override
+ bool get isStrongMode => true;
+
+ @override
bool get mayCheckTypesOfLocals => false;
@override
@@ -686,13 +698,15 @@ var v = new C().m(1, b: 'bbb', c: 2.0);
@reflectiveTest
class ResynthesizeAstSpecTest extends _ResynthesizeAstTest {
@override
- AnalysisOptionsImpl createOptions() =>
- super.createOptions()..strongMode = false;
+ bool get isStrongMode => false;
}
@reflectiveTest
class ResynthesizeAstStrongTest extends _ResynthesizeAstTest {
@override
+ bool get isStrongMode => true;
+
+ @override
AnalysisOptionsImpl createOptions() =>
super.createOptions()..strongMode = true;
@@ -880,6 +894,8 @@ abstract class _AstResynthesizeTestMixinInterface {
abstract class _ResynthesizeAstTest extends ResynthesizeTest
with _AstResynthesizeTestMixin {
+ bool get isStrongMode;
+
@override
LibraryElementImpl checkLibrary(String text,
{bool allowErrors: false, bool dumpSummaries: false}) {
@@ -907,6 +923,10 @@ abstract class _ResynthesizeAstTest extends ResynthesizeTest
DartSdk createDartSdk() => AbstractContextTest.SHARED_MOCK_SDK;
@override
+ AnalysisOptionsImpl createOptions() =>
+ super.createOptions()..strongMode = isStrongMode;
+
+ @override
TestSummaryResynthesizer encodeDecodeLibrarySource(Source source) {
return _encodeLibrary(source);
}
« no previous file with comments | « pkg/analyzer/test/src/summary/element_text.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698