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

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

Issue 2775633002: Use ansi color in the dartanalyzer cli output. (Closed)
Patch Set: make tests more robust Created 3 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
« no previous file with comments | « pkg/analyzer_cli/test/driver_test.dart ('k') | pkg/analyzer_cli/test/super_mixin_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 078f36da05fb46034dded2c145017cdab550084f..4fab7bd25ae74bec2cd585bd1d3249737507275a 100644
--- a/pkg/analyzer_cli/test/reporter_test.dart
+++ b/pkg/analyzer_cli/test/reporter_test.dart
@@ -5,6 +5,7 @@
library analyzer_cli.test.formatter;
import 'package:analyzer/analyzer.dart';
+import 'package:analyzer_cli/src/ansi.dart' as ansi;
import 'package:analyzer_cli/src/error_formatter.dart';
import 'package:test/test.dart' hide ErrorFormatter;
import 'package:typed_mock/typed_mock.dart';
@@ -16,8 +17,15 @@ main() {
var out = new StringBuffer();
var stats = new AnalysisStats();
- setUp(() => stats.init());
- tearDown(() => out.clear());
+ setUp(() {
+ ansi.runningTests = true;
+ stats.init();
+ });
+
+ tearDown(() {
+ out.clear();
+ ansi.runningTests = false;
+ });
// Options
var options = new MockCommandLineOptions();
@@ -33,7 +41,7 @@ main() {
reporter.formatErrors([error]);
expect(out.toString().trim(),
- '[error] MSG at /foo/bar/baz.dart:3:3 (mock_code).');
+ 'error • MSG at /foo/bar/baz.dart:3:3 • mock_code');
});
test('hint', () {
@@ -41,7 +49,7 @@ main() {
reporter.formatErrors([error]);
expect(out.toString().trim(),
- '[hint] MSG at /foo/bar/baz.dart:3:3 (mock_code).');
+ 'hint • MSG at /foo/bar/baz.dart:3:3 • mock_code');
});
test('stats', () {
@@ -50,7 +58,7 @@ main() {
stats.print(out);
expect(
out.toString().trim(),
- '[hint] MSG at /foo/bar/baz.dart:3:3 (mock_code).\n'
+ 'hint • MSG at /foo/bar/baz.dart:3:3 • mock_code\n'
'1 hint found.');
});
});
« no previous file with comments | « pkg/analyzer_cli/test/driver_test.dart ('k') | pkg/analyzer_cli/test/super_mixin_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698