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

Unified Diff: pkg/analyzer_cli/test/reporter_test.dart

Issue 1810103003: Analyzer directory recursing (tk 2) (#25129). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: re-apply tk 1 Created 4 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: pkg/analyzer_cli/test/reporter_test.dart
diff --git a/pkg/analyzer_cli/test/reporter_test.dart b/pkg/analyzer_cli/test/reporter_test.dart
index 94b089649b32ebbefd2cdccec493afcfeefe0e1b..3a0853bdf6b467342e520e5570d59a29ff4e3ffd 100644
--- a/pkg/analyzer_cli/test/reporter_test.dart
+++ b/pkg/analyzer_cli/test/reporter_test.dart
@@ -14,7 +14,9 @@ import 'mocks.dart';
main() {
group('reporter', () {
var out = new StringBuffer();
+ var stats = new AnalysisStats();
+ setUp(() => stats.init());
tearDown(() => out.clear());
// Options
@@ -23,28 +25,32 @@ main() {
when(options.hintsAreFatal).thenReturn(false);
when(options.machineFormat).thenReturn(false);
- var reporter = new ErrorFormatter(out, options);
+ var reporter = new ErrorFormatter(out, options, stats);
test('error', () {
var error = mockError(ErrorType.SYNTACTIC_ERROR, ErrorSeverity.ERROR);
reporter.formatErrors([error]);
- expect(
- out.toString(),
- '''[error] MSG (/foo/bar/baz.dart, line 3, col 3)
-1 error found.
-''');
+ expect(out.toString().trim(),
+ '[error] MSG (/foo/bar/baz.dart, line 3, col 3)');
});
test('hint', () {
var error = mockError(ErrorType.HINT, ErrorSeverity.INFO);
reporter.formatErrors([error]);
+ expect(out.toString().trim(),
+ '[hint] MSG (/foo/bar/baz.dart, line 3, col 3)');
+ });
+
+ test('stats', () {
+ var error = mockError(ErrorType.HINT, ErrorSeverity.INFO);
+ reporter.formatErrors([error]);
+ stats.print(out);
expect(
- out.toString(),
+ out.toString().trim(),
'''[hint] MSG (/foo/bar/baz.dart, line 3, col 3)
-1 hint found.
-''');
+1 hint found.''');
});
});
}
« pkg/analyzer_cli/lib/src/driver.dart ('K') | « pkg/analyzer_cli/lib/src/package_analyzer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698