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

Side by Side Diff: lib/src/io.dart

Issue 913123006: Add a ConsoleReporter for printing human-friendly test progress reports. (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 unified diff | Download patch
« lib/src/console_reporter.dart ('K') | « lib/src/console_reporter.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library unittest.io;
6
7 import 'dart:io';
8
9 /// Whether "special" strings such as Unicode characters or color escapes are
10 /// safe to use.
11 ///
12 /// On Windows or when not printing to a terminal, only printable ASCII
13 /// characters should be used.
14 bool get canUseSpecialChars =>
15 Platform.operatingSystem != 'windows' &&
16 stdioType(stdout) == StdioType.TERMINAL;
17
18 /// Gets a "special" string (ANSI escape or Unicode).
19 ///
20 /// On Windows or when not printing to a terminal, returns something else since
21 /// those aren't supported.
22 String getSpecial(String special, [String onWindows = '']) =>
23 canUseSpecialChars ? special : onWindows;
OLDNEW
« lib/src/console_reporter.dart ('K') | « lib/src/console_reporter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698