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 library test_utils; | 5 library test_utils; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
10 import 'package:scheduled_test/src/utils.dart'; | 10 import 'package:scheduled_test/src/utils.dart'; |
11 import 'package:scheduled_test/src/mock_clock.dart' as mock_clock; | 11 import 'package:scheduled_test/src/mock_clock.dart' as mock_clock; |
12 | 12 |
13 import 'metatest.dart'; | 13 import 'package:metatest/metatest.dart'; |
14 | 14 |
15 export 'package:scheduled_test/src/utils.dart'; | 15 export 'package:scheduled_test/src/utils.dart'; |
16 | 16 |
17 /// Wraps [input] to provide a timeout. If [input] completes before | 17 /// Wraps [input] to provide a timeout. If [input] completes before |
18 /// [milliseconds] have passed, then the return value completes in the same way. | 18 /// [milliseconds] have passed, then the return value completes in the same way. |
19 /// However, if [milliseconds] pass before [input] has completed, [onTimeout] is | 19 /// However, if [milliseconds] pass before [input] has completed, [onTimeout] is |
20 /// run and its result is passed to [input] (with chaining, if it returns a | 20 /// run and its result is passed to [input] (with chaining, if it returns a |
21 /// [Future]). | 21 /// [Future]). |
22 /// | 22 /// |
23 /// Note that timing out will not cancel the asynchronous operation behind | 23 /// Note that timing out will not cancel the asynchronous operation behind |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 testBody(); | 82 testBody(); |
83 }); | 83 }); |
84 | 84 |
85 test('validate errors', () { | 85 test('validate errors', () { |
86 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 86 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
87 validator(errors); | 87 validator(errors); |
88 }); | 88 }); |
89 }, passing: ['validate errors']); | 89 }, passing: ['validate errors']); |
90 } | 90 } |
OLD | NEW |