@@ -137,17 +137,18 @@ library unittest;
137
137
import 'dart:async' ;
138
138
import 'dart:collection' ;
139
139
import 'dart:isolate' ;
140
- import 'package:stack_trace/stack_trace.dart' ;
141
140
142
141
import 'package:matcher/matcher.dart' show DefaultFailureHandler,
143
142
configureExpectFailureHandler, TestFailure, wrapAsync;
144
143
export 'package:matcher/matcher.dart' ;
145
144
146
145
import 'src/utils.dart' ;
147
146
148
- part 'src/configuration.dart' ;
149
- part 'src/group_context.dart' ;
147
+ import 'src/configuration.dart' ;
148
+ export 'src/configuration.dart' ;
149
+
150
150
part 'src/simple_configuration.dart' ;
151
+ part 'src/group_context.dart' ;
151
152
part 'src/spread_args_helper.dart' ;
152
153
part 'src/test_case.dart' ;
153
154
@@ -300,30 +301,6 @@ Function expectAsync(Function callback,
300
301
{int count: 1 , int max: 0 , String id}) =>
301
302
new _SpreadArgsHelper (callback, count, max, id).func;
302
303
303
- /// *Deprecated*
304
- ///
305
- /// Use [expectAsync] instead.
306
- @deprecated
307
- Function expectAsync0 (Function callback,
308
- {int count: 1 , int max: 0 , String id}) =>
309
- expectAsync (callback, count: count, max: max, id: id);
310
-
311
- /// *Deprecated*
312
- ///
313
- /// Use [expectAsync] instead.
314
- @deprecated
315
- Function expectAsync1 (Function callback,
316
- {int count: 1 , int max: 0 , String id}) =>
317
- expectAsync (callback, count: count, max: max, id: id);
318
-
319
- /// *Deprecated*
320
- ///
321
- /// Use [expectAsync] instead.
322
- @deprecated
323
- Function expectAsync2 (Function callback,
324
- {int count: 1 , int max: 0 , String id}) =>
325
- expectAsync (callback, count: count, max: max, id: id);
326
-
327
304
/// Indicate that [callback] is expected to be called until [isDone] returns
328
305
/// true. The unittest framework check [isDone] after each callback and only
329
306
/// when it returns true will it continue with the following test. Using
@@ -335,57 +312,6 @@ Function expectAsync2(Function callback,
335
312
Function expectAsyncUntil (Function callback, bool isDone (), {String id}) =>
336
313
new _SpreadArgsHelper (callback, 0 , - 1 , id, isDone: isDone).func;
337
314
338
- /// *Deprecated*
339
- ///
340
- /// Use [expectAsyncUntil] instead.
341
- @deprecated
342
- Function expectAsyncUntil0 (Function callback, Function isDone, {String id}) =>
343
- expectAsyncUntil (callback, isDone, id: id);
344
-
345
- /// *Deprecated*
346
- ///
347
- /// Use [expectAsyncUntil] instead.
348
- @deprecated
349
- Function expectAsyncUntil1 (Function callback, Function isDone, {String id}) =>
350
- expectAsyncUntil (callback, isDone, id: id);
351
-
352
- /// *Deprecated*
353
- ///
354
- /// Use [expectAsyncUntil] instead.
355
- @deprecated
356
- Function expectAsyncUntil2 (Function callback, Function isDone, {String id}) =>
357
- expectAsyncUntil (callback, isDone, id: id);
358
-
359
- /// *Deprecated*
360
- ///
361
- /// All tests are now run an isolated [Zone] .
362
- ///
363
- /// You can safely remove calls to this method.
364
- @deprecated
365
- Function protectAsync0 (Function callback, {String id}) {
366
- return callback;
367
- }
368
-
369
- /// *Deprecated*
370
- ///
371
- /// All tests are now run an isolated [Zone] .
372
- ///
373
- /// You can safely remove calls to this method.
374
- @deprecated
375
- Function protectAsync1 (Function callback, {String id}) {
376
- return callback;
377
- }
378
-
379
- /// *Deprecated*
380
- ///
381
- /// All tests are now run an isolated [Zone] .
382
- ///
383
- /// You can safely remove calls to this method.
384
- @deprecated
385
- Function protectAsync2 (Function callback, {String id}) {
386
- return callback;
387
- }
388
-
389
315
/// Creates a new named group of tests. Calls to group() or test() within the
390
316
/// body of the function passed to this will inherit this group's description.
391
317
void group (String description, void body ()) {
@@ -488,16 +414,6 @@ void runTests() {
488
414
_runTest ();
489
415
}
490
416
491
- /// *Deprecated*
492
- ///
493
- /// All tests are now run an isolated [Zone] .
494
- ///
495
- /// You can safely remove calls to this method.
496
- @deprecated
497
- guardAsync (Function tryBody) {
498
- return tryBody ();
499
- }
500
-
501
417
/// Registers that an exception was caught for the current test.
502
418
void registerException (e, [trace]) {
503
419
_registerException (currentTestCase, e, trace);
@@ -646,26 +562,3 @@ void _requireNotRunning() {
646
562
throw new StateError ('Not allowed when tests are running.' );
647
563
}
648
564
}
649
-
650
- /// Returns a Trace object from a StackTrace object or a String, or the
651
- /// unchanged input if formatStacks is false;
652
- Trace _getTrace (stack) {
653
- Trace trace;
654
- if (stack == null || ! formatStacks) return null ;
655
- if (stack is String ) {
656
- trace = new Trace .parse (stack);
657
- } else if (stack is StackTrace ) {
658
- trace = new Trace .from (stack);
659
- } else {
660
- throw new Exception ('Invalid stack type ${stack .runtimeType } for $stack .' );
661
- }
662
-
663
- if (! filterStacks) return trace;
664
-
665
- // Format the stack trace by removing everything above TestCase._runTest,
666
- // which is usually going to be irrelevant. Also fold together unittest and
667
- // core library calls so only the function the user called is visible.
668
- return new Trace (trace.frames.takeWhile ((frame) {
669
- return frame.package != 'unittest' || frame.member != 'TestCase._runTest' ;
670
- })).terse.foldFrames ((frame) => frame.package == 'unittest' || frame.isCore);
671
- }
0 commit comments