Index: pkg/unittest/lib/src/utils.dart |
diff --git a/pkg/unittest/lib/src/utils.dart b/pkg/unittest/lib/src/utils.dart |
index 6442ac43897395373b96085e2444a1b512e1787c..e10c597d3f0bda8623e088418d86b5f287e07aac 100644 |
--- a/pkg/unittest/lib/src/utils.dart |
+++ b/pkg/unittest/lib/src/utils.dart |
@@ -46,3 +46,24 @@ String _escapeChar(String ch) { |
return ch; |
} |
+/** Indent each line in [str] by two spaces. */ |
+String indent(String str) => |
+ str.replaceAll(new RegExp("^", multiLine: true), " "); |
+ |
+/** A pair of values. */ |
+class Pair<E, F> { |
+ E first; |
+ F last; |
+ |
+ Pair(this.first, this.last); |
+ |
+ String toString() => '($first, $last)'; |
+ |
+ bool operator==(other) { |
+ if (other is! Pair) return false; |
+ return other.first == first && other.last == last; |
+ } |
+ |
+ int get hashCode => first.hashCode ^ last.hashCode; |
+} |
+ |