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

Unified Diff: lib/src/testing.dart

Issue 1230903002: fixes #6, refactor to use AnalysisError/Listener throughout dev_compiler (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « lib/src/summary.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/testing.dart
diff --git a/lib/src/testing.dart b/lib/src/testing.dart
index 877570bbee21c9193208e1e4bfcd9a988822c8aa..aaf790141ae866287f45e9ecfbdcf37e057302f8 100644
--- a/lib/src/testing.dart
+++ b/lib/src/testing.dart
@@ -178,7 +178,7 @@ class _ExpectedErrorVisitor extends UnifyingAstVisitor {
var actualMsg = _formatActualError(actual);
expect(_actualErrorLevel(actual), expected.level,
reason: 'expected different error code at:\n\n$actualMsg');
- expect(actual.errorCode.name, expected.typeName,
+ expect(errorCodeName(actual.errorCode), expected.typeName,
reason: 'expected different error type at:\n\n$actualMsg');
// We found it. Stop the search.
@@ -205,12 +205,12 @@ class _ExpectedErrorVisitor extends UnifyingAstVisitor {
var span = _createSpan(actual.offset, actual.length);
var levelName = _actualErrorLevel(actual).name.toLowerCase();
var msg = span.message(actual.message, color: colorOf(levelName));
- return '$levelName: [${actual.errorCode.name}] $msg';
+ return '$levelName: [${errorCodeName(actual.errorCode)}] $msg';
}
SourceSpan _createSpan(int offset, int len) {
return createSpanHelper(
- _unit, offset, offset + len, _unit.element.source, _unitSourceCode);
+ _unit.lineInfo, offset, offset + len, _unit.element.source, _unitSourceCode);
}
}
« no previous file with comments | « lib/src/summary.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698