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

Unified Diff: unittest/lib/src/matcher/description.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « unittest/lib/src/matcher/core_matchers.dart ('k') | unittest/lib/src/matcher/error_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unittest/lib/src/matcher/description.dart
diff --git a/unittest/lib/src/matcher/description.dart b/unittest/lib/src/matcher/description.dart
deleted file mode 100644
index 3f2862fa45b6ee539ac4dadabb3266e5245c031a..0000000000000000000000000000000000000000
--- a/unittest/lib/src/matcher/description.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library unittest.matcher.description;
-
-import 'interfaces.dart';
-import 'pretty_print.dart';
-
-/// The default implementation of [Description]. This should rarely need
-/// substitution, although conceivably it is a place where other languages
-/// could be supported.
-class StringDescription implements Description {
- final StringBuffer _out = new StringBuffer();
-
- /// Initialize the description with initial contents [init].
- StringDescription([String init = '']) {
- _out.write(init);
- }
-
- int get length => _out.length;
-
- /// Get the description as a string.
- String toString() => _out.toString();
-
- /// Append [text] to the description.
- Description add(String text) {
- _out.write(text);
- return this;
- }
-
- /// Change the value of the description.
- Description replace(String text) {
- _out.clear();
- return add(text);
- }
-
- /// Appends a description of [value]. If it is an IMatcher use its
- /// describe method; if it is a string use its literal value after
- /// escaping any embedded control characters; otherwise use its
- /// toString() value and wrap it in angular "quotes".
- Description addDescriptionOf(value) {
- if (value is Matcher) {
- value.describe(this);
- } else {
- add(prettyPrint(value, maxLineLength: 80, maxItems: 25));
- }
- return this;
- }
-
- /// Append an [Iterable] [list] of objects to the description, using the
- /// specified [separator] and framing the list with [start]
- /// and [end].
- Description addAll(
- String start, String separator, String end, Iterable list) {
- var separate = false;
- add(start);
- for (var item in list) {
- if (separate) {
- add(separator);
- }
- addDescriptionOf(item);
- separate = true;
- }
- add(end);
- return this;
- }
-}
« no previous file with comments | « unittest/lib/src/matcher/core_matchers.dart ('k') | unittest/lib/src/matcher/error_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698