| OLD | NEW |
| 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 /** | 5 /** |
| 6 * A library for writing dart unit tests. | 6 * A library for writing dart unit tests. |
| 7 * | 7 * |
| 8 * ## Installing ## | 8 * ## Installing ## |
| 9 * | 9 * |
| 10 * Use [pub][] to install this package. Add the following to your `pubspec.yaml` | 10 * Use [pub][] to install this package. Add the following to your `pubspec.yaml` |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 * [Issue 2706](http://dartbug.com/2706)). | 139 * [Issue 2706](http://dartbug.com/2706)). |
| 140 * | 140 * |
| 141 * [pub]: http://pub.dartlang.org | 141 * [pub]: http://pub.dartlang.org |
| 142 * [pkg]: http://pub.dartlang.org/packages/unittest | 142 * [pkg]: http://pub.dartlang.org/packages/unittest |
| 143 */ | 143 */ |
| 144 library unittest; | 144 library unittest; |
| 145 | 145 |
| 146 import 'dart:async'; | 146 import 'dart:async'; |
| 147 import 'dart:collection'; | 147 import 'dart:collection'; |
| 148 import 'dart:isolate'; | 148 import 'dart:isolate'; |
| 149 import 'dart:math' show max; | |
| 150 import 'matcher.dart'; | 149 import 'matcher.dart'; |
| 151 export 'matcher.dart'; | 150 export 'matcher.dart'; |
| 152 | 151 |
| 153 import 'package:stack_trace/stack_trace.dart'; | 152 import 'package:stack_trace/stack_trace.dart'; |
| 154 | 153 |
| 155 import 'src/utils.dart'; | 154 import 'src/utils.dart'; |
| 156 part 'src/config.dart'; | 155 part 'src/config.dart'; |
| 157 part 'src/test_case.dart'; | 156 part 'src/test_case.dart'; |
| 158 | 157 |
| 159 Configuration _config; | 158 Configuration _config; |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 | 864 |
| 866 if (!formatStacks) return trace; | 865 if (!formatStacks) return trace; |
| 867 | 866 |
| 868 // Format the stack trace by removing everything above TestCase._runTest, | 867 // Format the stack trace by removing everything above TestCase._runTest, |
| 869 // which is usually going to be irrelevant. Also fold together unittest and | 868 // which is usually going to be irrelevant. Also fold together unittest and |
| 870 // core library calls so only the function the user called is visible. | 869 // core library calls so only the function the user called is visible. |
| 871 return new Trace(trace.frames.takeWhile((frame) { | 870 return new Trace(trace.frames.takeWhile((frame) { |
| 872 return frame.package != 'unittest' || frame.member != 'TestCase._runTest'; | 871 return frame.package != 'unittest' || frame.member != 'TestCase._runTest'; |
| 873 })).terse.foldFrames((frame) => frame.package == 'unittest' || frame.isCore); | 872 })).terse.foldFrames((frame) => frame.package == 'unittest' || frame.isCore); |
| 874 } | 873 } |
| OLD | NEW |