| 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'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:scheduled_test/scheduled_test.dart'; | 7 import 'package:scheduled_test/scheduled_test.dart'; |
| 8 import 'package:scheduled_test/src/mock_clock.dart' as mock_clock; | 8 import 'package:scheduled_test/src/mock_clock.dart' as mock_clock; |
| 9 | 9 |
| 10 import '../metatest.dart'; | 10 import '../metatest.dart'; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 }); | 83 }); |
| 84 | 84 |
| 85 test('test 2', () { | 85 test('test 2', () { |
| 86 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 86 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
| 87 expect(errors.map((e) => e.error), equals(['error'])); | 87 expect(errors.map((e) => e.error), equals(['error'])); |
| 88 }); | 88 }); |
| 89 }, passing: ['test 2']); | 89 }, passing: ['test 2']); |
| 90 | 90 |
| 91 expectTestsPass("nested scheduled blocks whose return values are passed to " | 91 expectTestsPass("nested scheduled blocks whose return values are passed to " |
| 92 "wrapFuture should report exceptions once", () { | 92 "wrapFuture should report exceptions once", () { |
| 93 var error = new Object(); | 93 var error = 'oh no!'; |
| 94 var errors; | 94 var errors; |
| 95 test('test 1', () { | 95 test('test 1', () { |
| 96 currentSchedule.onException.schedule(() { | 96 currentSchedule.onException.schedule(() { |
| 97 errors = currentSchedule.errors; | 97 errors = currentSchedule.errors; |
| 98 }); | 98 }); |
| 99 | 99 |
| 100 schedule(() { | 100 schedule(() { |
| 101 wrapFuture(schedule(() { | 101 wrapFuture(schedule(() { |
| 102 throw error; | 102 throw error; |
| 103 })); | 103 })); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 130 parentTaskFinished = true; | 130 parentTaskFinished = true; |
| 131 }); | 131 }); |
| 132 }); | 132 }); |
| 133 }); | 133 }); |
| 134 | 134 |
| 135 test('test 2', () { | 135 test('test 2', () { |
| 136 expect(parentTaskFinishedBeforeOnComplete, isTrue); | 136 expect(parentTaskFinishedBeforeOnComplete, isTrue); |
| 137 }); | 137 }); |
| 138 }, passing: ['test 2']); | 138 }, passing: ['test 2']); |
| 139 } | 139 } |
| OLD | NEW |