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

Unified Diff: pkg/analyzer_cli/test/super_mixin_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/reporter_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/test/super_mixin_test.dart
diff --git a/pkg/analyzer_cli/test/super_mixin_test.dart b/pkg/analyzer_cli/test/super_mixin_test.dart
index de1ad1af92355b7db2f46bff3d87fdb33248e952..d5cec87b380244dcaae64a3a4bcd8376975e1989 100644
--- a/pkg/analyzer_cli/test/super_mixin_test.dart
+++ b/pkg/analyzer_cli/test/super_mixin_test.dart
@@ -6,6 +6,7 @@ library analyzer_cli.test.super_mixin;
import 'dart:io';
+import 'package:analyzer_cli/src/ansi.dart' as ansi;
import 'package:analyzer_cli/src/driver.dart' show Driver, errorSink, outSink;
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
@@ -23,17 +24,21 @@ void main() {
group('--supermixins', () {
StringSink savedOutSink, savedErrorSink;
int savedExitCode;
+
setUp(() {
+ ansi.runningTests = true;
savedOutSink = outSink;
savedErrorSink = errorSink;
savedExitCode = exitCode;
outSink = new StringBuffer();
errorSink = new StringBuffer();
});
+
tearDown(() {
outSink = savedOutSink;
errorSink = savedErrorSink;
exitCode = savedExitCode;
+ ansi.runningTests = false;
});
test('produces errors when option absent', () async {
@@ -45,11 +50,11 @@ void main() {
expect(
stdout,
contains(
- "[error] The class 'C' can't be used as a mixin because it extends a class other than Object"));
+ "error • The class 'C' can't be used as a mixin because it extends a class other than Object"));
expect(
stdout,
contains(
- "[error] The class 'C' can't be used as a mixin because it references 'super'"));
+ "error • The class 'C' can't be used as a mixin because it references 'super'"));
expect(stdout, contains('2 errors found.'));
expect(errorSink.toString(), '');
});
« no previous file with comments | « pkg/analyzer_cli/test/reporter_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698