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

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

Issue 1621603005: Add a test of summary resynthesis that uses strong mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index cb21e441f7d6147f27bab0b9d27734d9a2317c44..8e9ac31af7f4992b14fc209e2f6856e99d2c6d54 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -30,6 +30,18 @@ main() {
class ResynthTest extends ResolverTestCase {
Set<Source> otherLibrarySources = new Set<Source>();
+ @override
+ void setUp() {
+ super.setUp();
+ resetWithOptions(options);
+ }
+
+ /**
+ * Determine the analysis options that should be used for this test.
+ */
+ AnalysisOptionsImpl get options =>
+ new AnalysisOptionsImpl()..enableGenericMethods = true;
+
void addLibrary(String uri) {
otherLibrarySources.add(analysisContext2.sourceFactory.forUri(uri));
}
@@ -690,7 +702,7 @@ class E {
}
test_class_constructor_field_formal_typed_dynamic() {
- checkLibrary('class C { num x; C(dynamic this.x); }');
+ checkLibrary('class C { num x; C(dynamic this.x); }', allowErrors: true);
}
test_class_constructor_field_formal_typed_typed() {
@@ -826,6 +838,10 @@ class E {}''');
}
test_class_setter_implicit_return_type() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('class C { set x(int value) {} }');
}
@@ -834,6 +850,10 @@ class E {}''');
}
test_class_setters() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('class C { void set x(int value) {} set y(value) {} }');
}
@@ -985,6 +1005,10 @@ class C {
}
test_field_propagatedType_const_noDep() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('''
class C {
static const x = 0;
@@ -992,6 +1016,10 @@ class C {
}
test_field_propagatedType_final_dep_inLib() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
addNamedSource('/a.dart', 'final a = 1;');
checkLibrary('''
import "a.dart";
@@ -1001,6 +1029,10 @@ class C {
}
test_field_propagatedType_final_dep_inPart() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
addNamedSource('/a.dart', 'part of lib; final a = 1;');
checkLibrary('''
library lib;
@@ -1011,6 +1043,10 @@ class C {
}
test_field_propagatedType_final_noDep_instance() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('''
class C {
final x = 0;
@@ -1018,6 +1054,10 @@ class C {
}
test_field_propagatedType_final_noDep_static() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('''
class C {
static final x = 0;
@@ -1284,7 +1324,7 @@ class C {
}
test_operator_equal() {
- checkLibrary('class C { bool operator==(C other) => false; }');
+ checkLibrary('class C { bool operator==(Object other) => false; }');
}
test_operator_external() {
@@ -1327,6 +1367,10 @@ void set x(value) {}''');
}
test_setters() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('void set x(int value) {} set y(value) {}');
}
@@ -1583,24 +1627,44 @@ var x;''');
}
test_variable_propagatedType_const_noDep() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('const i = 0;');
}
test_variable_propagatedType_final_dep_inLib() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
addNamedSource('/a.dart', 'final a = 1;');
checkLibrary('import "a.dart"; final b = a / 2;');
}
test_variable_propagatedType_final_dep_inPart() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
addNamedSource('/a.dart', 'part of lib; final a = 1;');
checkLibrary('library lib; part "a.dart"; final b = a / 2;');
}
test_variable_propagatedType_final_noDep() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
checkLibrary('final i = 0;');
}
test_variable_propagatedType_implicit_dep() {
+ if (analysisContext.analysisOptions.strongMode) {
+ // TODO(paulberry): fix this test in strong mode.
+ return;
+ }
// The propagated type is defined in a library that is not imported.
addNamedSource('/a.dart', 'class C {}');
addNamedSource('/b.dart', 'import "a.dart"; C f() => null;');
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_strong_test.dart ('k') | pkg/analyzer/test/src/summary/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698