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

Unified Diff: lib/src/testing.dart

Issue 988483006: Add widget to display errors, and report dependency_graph errors correctly (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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: lib/src/testing.dart
diff --git a/lib/src/testing.dart b/lib/src/testing.dart
index 980bfbc958bd71d81fefccc95115d2842b5653d9..a80ad2114afb7604279d6561b3744e62006d51bd 100644
--- a/lib/src/testing.dart
+++ b/lib/src/testing.dart
@@ -97,7 +97,8 @@ CheckerResults testChecker(Map<String, String> testFiles,
var total = expectedErrors.values.fold(0, (p, l) => p + l.length);
// Check that all errors we emit are included in the expected map.
for (var lib in results.libraries) {
- (reporter as TestReporter).infoMap[lib].forEach((node, actual) {
+ var uri = lib.library.source.uri;
+ (reporter as TestReporter).infoMap[uri].forEach((node, actual) {
var expected = expectedErrors[node];
var expectedTotal = expected == null ? 0 : expected.length;
if (actual.length != expectedTotal) {
@@ -135,17 +136,18 @@ CheckerResults testChecker(Map<String, String> testFiles,
}
class TestReporter extends SummaryReporter {
- Map<LibraryInfo, Map<AstNode, List<StaticInfo>>> infoMap = {};
- LibraryInfo _current;
+ Map<Uri, Map<AstNode, List<StaticInfo>>> infoMap = {};
+ Uri _current;
- void enterLibrary(LibraryInfo info) {
- super.enterLibrary(info);
- infoMap[info] = {};
- _current = info;
+ void enterLibrary(Uri uri) {
+ super.enterLibrary(uri);
+ infoMap[uri] = {};
+ _current = uri;
}
- void log(StaticInfo info) {
+ void log(Message info) {
super.log(info);
+ if (info is! StaticInfo) return;
infoMap[_current].putIfAbsent(info.node, () => []).add(info);
}
}

Powered by Google App Engine
This is Rietveld 408576698