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

Unified Diff: tests/compiler/dart2js/equivalence/id_equivalence_helper.dart

Issue 2995353002: Test the CapturedScope for local functions (Closed)
Patch Set: Created 3 years, 4 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: tests/compiler/dart2js/equivalence/id_equivalence_helper.dart
diff --git a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart
index 13fb0160cc83f17dbc991454de79675100c4523d..551da358e859498d507ab5ce4ca00437c92765d5 100644
--- a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart
+++ b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart
@@ -184,7 +184,7 @@ Future checkCode(
reportHere(
data.compiler.reporter,
actualData.sourceSpan,
- 'Id $id for ${actualData.object} '
+ 'Id $id = ${actual} for ${actualData.object} '
'(${actualData.object.runtimeType}) '
'not expected in ${data.expectedMap.keys}');
print('--annotations diff--------------------------------------------');
@@ -193,7 +193,7 @@ Future checkCode(
}
Expect.equals('', actual);
} else {
- String expected = data.expectedMap.remove(id);
+ String expected = data.expectedMap[id];
if (actual != expected) {
reportHere(
data.compiler.reporter,
@@ -208,14 +208,17 @@ Future checkCode(
}
});
+ Set<Id> missingIds = new Set<Id>();
data.expectedMap.forEach((Id id, String expected) {
- reportHere(
- data.compiler.reporter,
- computeSpannable(data.elementEnvironment, data.mainUri, id),
- 'Expected $expected for id $id missing in ${data.actualMap.keys}');
+ if (!data.actualMap.containsKey(id)) {
+ missingIds.add(id);
+ reportHere(
+ data.compiler.reporter,
+ computeSpannable(data.elementEnvironment, data.mainUri, id),
+ 'Expected $expected for id $id missing in ${data.actualMap.keys}');
+ }
});
- Expect.isTrue(
- data.expectedMap.isEmpty, "Ids not found: ${data.expectedMap}.");
+ Expect.isTrue(missingIds.isEmpty, "Ids not found: ${missingIds}.");
}
/// Compute a [Spannable] from an [id] in the library [mainUri].

Powered by Google App Engine
This is Rietveld 408576698