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

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

Issue 2775633002: Use ansi color in the dartanalyzer cli output. (Closed)
Patch Set: 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
Index: pkg/analyzer_cli/test/driver_test.dart
diff --git a/pkg/analyzer_cli/test/driver_test.dart b/pkg/analyzer_cli/test/driver_test.dart
index 30cc93ac16f2f66587ac8c0748547e2bb3841231..e58c0e92c713a6c1ee357bd4ad5400e3947c53f8 100644
--- a/pkg/analyzer_cli/test/driver_test.dart
+++ b/pkg/analyzer_cli/test/driver_test.dart
@@ -14,6 +14,7 @@ import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/services/lint.dart';
+import 'package:analyzer_cli/src/ansi.dart' as ansi;
import 'package:analyzer_cli/src/driver.dart';
import 'package:analyzer_cli/src/options.dart';
import 'package:cli_util/cli_util.dart' show getSdkDir;
@@ -30,6 +31,7 @@ main() {
/// Base setup.
_setUp() {
+ ansi.runningTests = true;
savedOutSink = outSink;
savedErrorSink = errorSink;
savedExitHandler = exitHandler;
@@ -45,6 +47,7 @@ main() {
errorSink = savedErrorSink;
exitCode = savedExitCode;
exitHandler = savedExitHandler;
+ ansi.runningTests = false;
}
setUp(() => _setUp());
@@ -177,7 +180,7 @@ main() {
test('generates lints', () async {
await runLinter();
expect(outSink.toString(),
- contains('[lint] Name types using UpperCamelCase'));
+ contains('lint • Name types using UpperCamelCase'));
Brian Wilkerson 2017/03/23 17:09:51 Will this work on Windows? Perhaps we should expec
devoncarew 2017/03/25 22:33:17 There is some checking for 'ansi.runningTests' in
});
});
@@ -203,7 +206,7 @@ main() {
test('generates lints', () async {
await runLinter();
expect(outSink.toString(),
- contains('[lint] Name types using UpperCamelCase'));
+ contains('lint • Name types using UpperCamelCase'));
});
});
@@ -289,7 +292,7 @@ linter:
expect(
outSink.toString(),
contains(
- "[error] This function declares a return type of 'int'"));
+ "error • This function declares a return type of 'int'"));
expect(
outSink.toString(), contains("1 error and 1 warning found."));
});
@@ -328,7 +331,7 @@ linter:
ErrorSeverity.WARNING);
// Should not be made fatal by `--fatal-warnings`.
expect(outSink.toString(),
- contains("[warning] The function 'baz' isn't defined"));
+ contains("warning • The function 'baz' isn't defined"));
expect(
outSink.toString(), contains("1 error and 1 warning found."));
});

Powered by Google App Engine
This is Rietveld 408576698