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

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

Issue 2353773002: Remove 'serializeLibrary(LibraryElement)' and its tests. (Closed)
Patch Set: Actually run strong mode AST based resynthesize. Created 4 years, 3 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 e0f166d7e90d513c2f0a5df046c179d8ca22eb6a..c6ec856c8105a4960bbc7c4df1fd4ab9d7557326 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_ast_test.dart
@@ -26,12 +26,13 @@ import 'package:unittest/unittest.dart';
import '../context/abstract_context.dart';
import '../task/strong/inferred_type_test.dart';
-import 'resynthesize_test.dart';
+import 'resynthesize_common.dart';
import 'summary_common.dart';
main() {
groupSep = ' | ';
- defineReflectiveTests(ResynthesizeAstTest);
+ defineReflectiveTests(ResynthesizeAstSpecTest);
+ defineReflectiveTests(ResynthesizeAstStrongTest);
defineReflectiveTests(AstInferredTypeTest);
}
@@ -683,27 +684,65 @@ var v = new C().m(1, b: 'bbb', c: 2.0);
}
@reflectiveTest
-class ResynthesizeAstTest extends ResynthesizeTest
- with _AstResynthesizeTestMixin {
+class ResynthesizeAstSpecTest extends _ResynthesizeAstTest {
@override
- bool get checkPropagatedTypes => false;
+ AnalysisOptionsImpl createOptions() =>
+ super.createOptions()..strongMode = false;
+}
+@reflectiveTest
+class ResynthesizeAstStrongTest extends _ResynthesizeAstTest {
@override
- LibraryElementImpl checkLibrary(String text,
- {bool allowErrors: false, bool dumpSummaries: false}) {
- Source source = addTestSource(text);
- LibraryElementImpl resynthesized = _encodeDecodeLibraryElement(source);
- LibraryElementImpl original = context.computeLibraryElement(source);
- checkLibraryElements(original, resynthesized);
- return resynthesized;
+ AnalysisOptionsImpl createOptions() =>
+ super.createOptions()..strongMode = true;
+
+ @override
+ @failingTest
+ test_const_invokeConstructor_named_unresolved() {
+ super.test_const_invokeConstructor_named_unresolved();
}
@override
- DartSdk createDartSdk() => AbstractContextTest.SHARED_MOCK_SDK;
+ @failingTest
+ test_const_invokeConstructor_named_unresolved3() {
+ super.test_const_invokeConstructor_named_unresolved3();
+ }
@override
- TestSummaryResynthesizer encodeDecodeLibrarySource(Source source) {
- return _encodeLibrary(source);
+ @failingTest
+ test_instantiateToBounds_boundRefersToLaterTypeArgument() {
+ // TODO(paulberry): this is failing due to dartbug.com/27072.
+ super.test_instantiateToBounds_boundRefersToLaterTypeArgument();
+ }
+
+ @override
+ @failingTest
+ test_syntheticFunctionType_genericClosure() {
+ super.test_syntheticFunctionType_genericClosure();
+ }
+
+ @override
+ @failingTest
+ test_syntheticFunctionType_inGenericClass() {
+ super.test_syntheticFunctionType_inGenericClass();
+ }
+
+ @override
+ @failingTest
+ test_syntheticFunctionType_noArguments() {
+ super.test_syntheticFunctionType_noArguments();
+ }
+
+ @override
+ @failingTest
+ test_syntheticFunctionType_withArguments() {
+ super.test_syntheticFunctionType_withArguments();
+ }
+
+ @override
+ @failingTest
+ test_unused_type_parameter() {
+ super.test_unused_type_parameter();
}
}
@@ -863,3 +902,34 @@ abstract class _AstResynthesizeTestMixinInterface {
*/
bool get allowMissingFiles;
}
+
+abstract class _ResynthesizeAstTest extends ResynthesizeTest
+ with _AstResynthesizeTestMixin {
+ @override
+ bool get checkPropagatedTypes => false;
+
+ @override
+ LibraryElementImpl checkLibrary(String text,
+ {bool allowErrors: false, bool dumpSummaries: false}) {
+ Source source = addTestSource(text);
+ LibraryElementImpl resynthesized = _encodeDecodeLibraryElement(source);
+ LibraryElementImpl original = context.computeLibraryElement(source);
+ checkLibraryElements(original, resynthesized);
+ return resynthesized;
+ }
+
+ @override
+ void compareLocalElementsOfExecutable(ExecutableElement resynthesized,
+ ExecutableElement original, String desc) {
+ // We don't resynthesize local elements during link.
+ // So, we should not compare them.
+ }
+
+ @override
+ DartSdk createDartSdk() => AbstractContextTest.SHARED_MOCK_SDK;
+
+ @override
+ TestSummaryResynthesizer encodeDecodeLibrarySource(Source source) {
+ return _encodeLibrary(source);
+ }
+}
« no previous file with comments | « pkg/analyzer/test/src/summary/prelinker_test.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