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

Unified Diff: lib/src/utils.dart

Issue 1145373006: Remove a conflicting definition of runningAsTest. (Closed) Base URL: git@github.com:dart-lang/pub_test@master
Patch Set: Created 5 years, 7 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/io.dart ('k') | test/ascii_tree_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 16f6e03742b108e52f7aa6434617f5eb2ca3958f..27d56b438f12b1052104df8f117bb0165d641982 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -785,7 +785,7 @@ Future awaitObject(object) {
///
/// On Windows or when not printing to a terminal, only printable ASCII
/// characters should be used.
-bool get canUseSpecialChars => !runningAsTest &&
+bool get canUseSpecialChars => !runningFromTest && !runningAsTest &&
Platform.operatingSystem != 'windows' &&
stdioType(stdout) == StdioType.TERMINAL;
@@ -811,14 +811,10 @@ String prefixLines(String text, {String prefix: '| ', String firstPrefix}) {
return lines.join('\n');
}
-/// Whether pub is running as a subprocess in an integration test or in a unit
-/// test that has explicitly set this.
-bool runningAsTest = Platform.environment.containsKey('_PUB_TESTING');
-
/// Whether today is April Fools' day.
bool get isAprilFools {
// Tests should never see April Fools' output.
- if (runningAsTest) return false;
+ if (runningFromTest) return false;
var date = new DateTime.now();
return date.month == 4 && date.day == 1;
« no previous file with comments | « lib/src/io.dart ('k') | test/ascii_tree_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698