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 * Support for writing Dart unit tests. | 6 * Support for writing Dart unit tests. |
7 * | 7 * |
8 * For information on installing and importing this library, see the | 8 * For information on installing and importing this library, see the |
9 * [unittest package on pub.dartlang.org] | 9 * [unittest package on pub.dartlang.org] |
10 * (http://pub.dartlang.org/packages/unittest). | 10 * (http://pub.dartlang.org/packages/unittest). |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 * features or fixes to the current spec (e.g. see | 143 * features or fixes to the current spec (e.g. see |
144 * [Issue 2706](http://dartbug.com/2706)). | 144 * [Issue 2706](http://dartbug.com/2706)). |
145 */ | 145 */ |
146 library unittest; | 146 library unittest; |
147 | 147 |
148 import 'dart:async'; | 148 import 'dart:async'; |
149 import 'dart:collection'; | 149 import 'dart:collection'; |
150 import 'dart:isolate'; | 150 import 'dart:isolate'; |
151 import 'package:stack_trace/stack_trace.dart'; | 151 import 'package:stack_trace/stack_trace.dart'; |
152 | 152 |
153 import 'matcher.dart'; | 153 import 'package:matcher/matcher.dart' show DefaultFailureHandler, |
154 export 'matcher.dart'; | 154 configureExpectFailureHandler, TestFailure, wrapAsync; |
| 155 export 'package:matcher/matcher.dart'; |
155 | 156 |
156 import 'src/utils.dart'; | 157 import 'src/utils.dart'; |
157 | 158 |
158 part 'src/configuration.dart'; | 159 part 'src/configuration.dart'; |
159 part 'src/group_context.dart'; | 160 part 'src/group_context.dart'; |
160 part 'src/simple_configuration.dart'; | 161 part 'src/simple_configuration.dart'; |
161 part 'src/spread_args_helper.dart'; | 162 part 'src/spread_args_helper.dart'; |
162 part 'src/test_case.dart'; | 163 part 'src/test_case.dart'; |
163 | 164 |
164 Configuration _config; | 165 Configuration _config; |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 | 735 |
735 if (!filterStacks) return trace; | 736 if (!filterStacks) return trace; |
736 | 737 |
737 // Format the stack trace by removing everything above TestCase._runTest, | 738 // Format the stack trace by removing everything above TestCase._runTest, |
738 // which is usually going to be irrelevant. Also fold together unittest and | 739 // which is usually going to be irrelevant. Also fold together unittest and |
739 // core library calls so only the function the user called is visible. | 740 // core library calls so only the function the user called is visible. |
740 return new Trace(trace.frames.takeWhile((frame) { | 741 return new Trace(trace.frames.takeWhile((frame) { |
741 return frame.package != 'unittest' || frame.member != 'TestCase._runTest'; | 742 return frame.package != 'unittest' || frame.member != 'TestCase._runTest'; |
742 })).terse.foldFrames((frame) => frame.package == 'unittest' || frame.isCore); | 743 })).terse.foldFrames((frame) => frame.package == 'unittest' || frame.isCore); |
743 } | 744 } |
OLD | NEW |