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

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

Issue 1532763002: Fixes to mock SDK to enable dart:core to be summarized. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove a bogus comment Created 5 years 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
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f979b8d83fac8a4adb8baf965b5fabce5b1213fd..ec846a587063947c800725e865a9bfd81cfd8ae7 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -69,11 +69,12 @@ class ResynthTest extends ResolverTestCase {
void compareClassElements(
ClassElementImpl resynthesized, ClassElementImpl original, String desc) {
compareElements(resynthesized, original, desc);
- expect(resynthesized.fields.length, original.fields.length);
+ expect(resynthesized.fields.length, original.fields.length,
+ reason: '$desc fields.length');
for (int i = 0; i < resynthesized.fields.length; i++) {
String name = original.fields[i].name;
- compareFieldElements(
- resynthesized.getField(name), original.fields[i], '$desc.$name');
+ compareFieldElements(resynthesized.getField(name), original.fields[i],
+ '$desc.field $name');
}
compareTypes(
resynthesized.supertype, original.supertype, '$desc supertype');
@@ -173,7 +174,7 @@ class ResynthTest extends ResolverTestCase {
ElementImpl resynthesized, ElementImpl original, String desc) {
expect(resynthesized, isNotNull);
expect(resynthesized.kind, original.kind);
- expect(resynthesized.location, original.location);
+ expect(resynthesized.location, original.location, reason: desc);
expect(resynthesized.name, original.name);
for (Modifier modifier in Modifier.values) {
if (modifier == Modifier.MIXIN) {
@@ -362,7 +363,7 @@ class ResynthTest extends ResolverTestCase {
void compareTypes(DartType resynthesized, DartType original, String desc) {
if (original == null) {
- expect(resynthesized, isNull);
+ expect(resynthesized, isNull, reason: desc);
} else if (resynthesized is InterfaceTypeImpl &&
original is InterfaceTypeImpl) {
compareTypeImpls(resynthesized, original);
@@ -416,19 +417,6 @@ class ResynthTest extends ResolverTestCase {
// TODO(paulberry): test initializer
}
- fail_core() {
- // TODO(paulberry): figure out why this test is failing. It's possible
- // some of the elements in the core library fail to resynthesize properly
- // because of flaws in the mock SDK; it's also possible that there are bugs
- // in the summary logic which are not caught by other tests.
- String uri = 'dart:core';
- LibraryElementImpl original =
- resolve2(analysisContext2.sourceFactory.forUri(uri));
- LibraryElementImpl resynthesized =
- resynthesizeLibraryElement(uri, original);
- checkLibraryElements(original, resynthesized);
- }
-
PrelinkedLibrary getSummaryFor(LibraryElement lib) {
BuilderContext ctx = new BuilderContext();
List<int> summary = serializeLibrary(ctx, lib, typeProvider).toBuffer();
@@ -657,6 +645,15 @@ class E {
checkLibrary('class C {} class D {}');
}
+ test_core() {
+ String uri = 'dart:core';
+ LibraryElementImpl original =
+ resolve2(analysisContext2.sourceFactory.forUri(uri));
+ LibraryElementImpl resynthesized =
+ resynthesizeLibraryElement(uri, original);
+ checkLibraryElements(original, resynthesized);
+ }
+
test_enum_values() {
checkLibrary('enum E { v1, v2 }');
}
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698