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

Side by Side Diff: pkg/unittest/lib/src/utils.dart

Issue 19540015: Roll forward "Use package:stack_trace in unittest." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/lib/src/test_case.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library utils; 5 library utils;
6 6
7 /** 7 /**
8 * Returns the name of the type of [x], or "Unknown" if the type name can't be 8 * Returns the name of the type of [x], or "Unknown" if the type name can't be
9 * determined. 9 * determined.
10 */ 10 */
(...skipping 28 matching lines...) Expand all
39 else if (ch == '\n') 39 else if (ch == '\n')
40 return '\\n'; 40 return '\\n';
41 else if (ch == '\r') 41 else if (ch == '\r')
42 return '\\r'; 42 return '\\r';
43 else if (ch == '\t') 43 else if (ch == '\t')
44 return '\\t'; 44 return '\\t';
45 else 45 else
46 return ch; 46 return ch;
47 } 47 }
48 48
49 /** Indent each line in [str] by two spaces. */
50 String indent(String str) =>
51 str.replaceAll(new RegExp("^", multiLine: true), " ");
52
53 /** A pair of values. */
54 class Pair<E, F> {
55 E first;
56 F last;
57
58 Pair(this.first, this.last);
59
60 String toString() => '($first, $last)';
61
62 bool operator==(other) {
63 if (other is! Pair) return false;
64 return other.first == first && other.last == last;
65 }
66
67 int get hashCode => first.hashCode ^ last.hashCode;
68 }
69
OLDNEW
« no previous file with comments | « pkg/unittest/lib/src/test_case.dart ('k') | pkg/unittest/lib/unittest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698