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

Unified Diff: lib/src/io.dart

Issue 939383002: Run with colored output even within "pub run". (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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 | « lib/src/console_reporter.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/io.dart
diff --git a/lib/src/io.dart b/lib/src/io.dart
index dc909aae3a77323278762c672ead086928a12f01..fe69ab4dbb385759f1ef829755fdaf2bcf9e19ed 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -7,6 +7,7 @@ library unittest.io;
import 'dart:async';
import 'dart:io';
+// TODO(nweiz): Make this check [stdioType] once that works within "pub run".
/// Whether "special" strings such as Unicode characters or color escapes are
/// safe to use.
///
@@ -14,7 +15,7 @@ import 'dart:io';
/// characters should be used.
bool get canUseSpecialChars =>
Platform.operatingSystem != 'windows' &&
- stdioType(stdout) == StdioType.TERMINAL;
+ Platform.environment["_UNITTEST_USE_COLOR"] != "false";
/// Gets a "special" string (ANSI escape or Unicode).
///
« no previous file with comments | « lib/src/console_reporter.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698