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

Unified Diff: tests/utils/src/test_utils.dart

Issue 10170040: test rename overhaul: step 11 - tests/utils (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « tests/utils/src/dummy.dart ('k') | tests/utils/test_config.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/utils/src/test_utils.dart
diff --git a/tests/utils/src/test_utils.dart b/tests/utils/src/test_utils.dart
deleted file mode 100644
index 4380801a88b07b5572aa75ba02a7fd0860c04fa0..0000000000000000000000000000000000000000
--- a/tests/utils/src/test_utils.dart
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2011, 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('test_utils');
-
-/**
- * Removes eight spaces of leading indentation from a multiline string.
- *
- * Note that this is very sensitive to how the literals are styled. They should
- * be:
- * '''
- * Text starts on own line. Lines up with subsequent lines.
- * Lines are indented exactly 8 characters from the left margin.
- * Close is on the same line.'''
- *
- * This does nothing if text is only a single line.
- */
-// TODO(nweiz): Make this auto-detect the indentation level from the first
-// non-whitespace line.
-String cleanUpLiteral(String text) {
- var lines = text.split('\n');
- if (lines.length <= 1) return text;
-
- for (var j = 0; j < lines.length; j++) {
- if (lines[j].length > 8) {
- lines[j] = lines[j].substring(8, lines[j].length);
- } else {
- lines[j] = '';
- }
- }
-
- return Strings.join(lines, '\n');
-}
-
-/**
- * Indents each line of [text] so that, when passed to [cleanUpLiteral], it will
- * produce output identical to [text].
- *
- * This is useful for literals that need to include newlines but can't be
- * conveniently represented as multi-line strings.
- */
-// TODO(nweiz): Once cleanUpLiteral is fixed, get rid of this.
-String indentLiteral(String text) {
- var lines = text.split('\n');
- if (lines.length <= 1) return text;
-
- for (var i = 0; i < lines.length; i++) {
- lines[i] = " ${lines[i]}";
- }
-
- return Strings.join(lines, "\n");
-}
« no previous file with comments | « tests/utils/src/dummy.dart ('k') | tests/utils/test_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698