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 import 'dart:async'; | |
6 | |
7 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
8 | 6 |
9 import 'package:metatest/metatest.dart'; | |
10 import '../utils.dart'; | 7 import '../utils.dart'; |
11 | 8 |
12 void main() { | 9 void main() { |
13 setUpMockClock(); | 10 setUpMockClock(); |
14 | 11 |
15 expectTestFailure('currentSchedule.errors contains the error in the ' | 12 expectTestFailure('currentSchedule.errors contains the error in the ' |
16 'onComplete queue', () { | 13 'onComplete queue', () { |
17 throw 'error'; | 14 throw 'error'; |
18 }, (error) => expect(error, equals('error'))); | 15 }, (error) => expect(error, equals('error'))); |
19 | 16 |
(...skipping 17 matching lines...) Expand all Loading... |
37 mockClock.run(); | 34 mockClock.run(); |
38 | 35 |
39 sleep(1).then(expectAsync((_) { | 36 sleep(1).then(expectAsync((_) { |
40 throw 'error1'; | 37 throw 'error1'; |
41 })); | 38 })); |
42 sleep(2).then(expectAsync((_) { | 39 sleep(2).then(expectAsync((_) { |
43 throw 'error2'; | 40 throw 'error2'; |
44 })); | 41 })); |
45 }, (error) => expect(error, equals('error1'))); | 42 }, (error) => expect(error, equals('error1'))); |
46 } | 43 } |
OLD | NEW |