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

Unified Diff: lib/src/utils.dart

Issue 934413002: Replace the existing unittest APIs with the new runner infrastructure. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/throws_matcher.dart ('k') | lib/test_controller.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 5c12593e4f4bd8864c07210b527dab933c905340..6b0939fe5ccf805bcf9ffb33e5e9d86b045eb1c1 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -28,23 +28,6 @@ String getErrorMessage(error) =>
String indent(String str) =>
str.replaceAll(new RegExp("^", multiLine: true), " ");
-/// A pair of values.
-class Pair<E, F> {
- final E first;
- final 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;
-}
-
/// A regular expression matching the path to a temporary file used to start an
/// isolate.
///
@@ -64,29 +47,6 @@ Chain terseChain(StackTrace stackTrace) {
}, terse: true);
}
-/// Returns a Trace object from a StackTrace object or a String, or the
-/// unchanged input if formatStacks is false;
-Trace getTrace(stack, bool formatStacks, bool filterStacks) {
- Trace trace;
- if (stack == null || !formatStacks) return null;
- if (stack is String) {
- trace = new Trace.parse(stack);
- } else if (stack is StackTrace) {
- trace = new Trace.from(stack);
- } else {
- throw new Exception('Invalid stack type ${stack.runtimeType} for $stack.');
- }
-
- if (!filterStacks) return trace;
-
- // Format the stack trace by removing everything above TestCase._runTest,
- // which is usually going to be irrelevant. Also fold together unittest and
- // core library calls so only the function the user called is visible.
- return new Trace(trace.frames.takeWhile((frame) {
- return frame.package != 'unittest' || frame.member != 'TestCase._runTest';
- })).terse.foldFrames((frame) => frame.package == 'unittest' || frame.isCore);
-}
-
/// Flattens nested [Iterable]s inside an [Iterable] into a single [List]
/// containing only non-[Iterable] elements.
List flatten(Iterable nested) {
« no previous file with comments | « lib/src/throws_matcher.dart ('k') | lib/test_controller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698