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.'''); |
}); |
}); |
} |