Index: pkg/scheduled_test/test/scheduled_test_test.dart |
diff --git a/pkg/scheduled_test/test/scheduled_test_test.dart b/pkg/scheduled_test/test/scheduled_test_test.dart |
index 1b8b29bd52588f667fd44b0e149b5ffba330864f..690319c613382ee020e402af6eb1591674c65f04 100644 |
--- a/pkg/scheduled_test/test/scheduled_test_test.dart |
+++ b/pkg/scheduled_test/test/scheduled_test_test.dart |
@@ -293,20 +293,20 @@ void main() { |
}); |
}, passing: ['test 2']); |
- expectTestsPass('currentSchedule.errors contains the error in the onComplete ' |
+ expectTestsPass('currentSchedule.error contains the error in the onComplete ' |
'queue', () { |
- var errors; |
+ var error; |
test('test 1', () { |
currentSchedule.onComplete.schedule(() { |
- errors = currentSchedule.errors; |
+ error = currentSchedule.error; |
}); |
throw 'error'; |
}); |
test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), equals(['error'])); |
+ expect(error, new isInstanceOf<ScheduleError>()); |
+ expect(error.error, equals('error')); |
}); |
}, passing: ['test 2']); |
@@ -395,147 +395,71 @@ void main() { |
}); |
}, passing: ['test 2']); |
- expectTestsPass('currentSchedule.errors contains the error in the ' |
- 'onException queue', () { |
- var errors; |
+ expectTestsPass('currentSchedule.error contains the error in the onException ' |
+ 'queue', () { |
+ var error; |
test('test 1', () { |
currentSchedule.onException.schedule(() { |
- errors = currentSchedule.errors; |
+ error = currentSchedule.error; |
}); |
throw 'error'; |
}); |
test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), equals(['error'])); |
+ expect(error, new isInstanceOf<ScheduleError>()); |
+ expect(error.error, equals('error')); |
}); |
}, passing: ['test 2']); |
- expectTestsPass('currentSchedule.errors contains an error passed into ' |
+ expectTestsPass('currentSchedule.error contains an error passed into ' |
'signalError synchronously', () { |
- var errors; |
+ var error; |
test('test 1', () { |
currentSchedule.onException.schedule(() { |
- errors = currentSchedule.errors; |
+ error = currentSchedule.error; |
}); |
currentSchedule.signalError('error'); |
}); |
test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), equals(['error'])); |
+ expect(error, new isInstanceOf<ScheduleError>()); |
+ expect(error.error, equals('error')); |
}); |
}, passing: ['test 2']); |
- expectTestsPass('currentSchedule.errors contains an error passed into ' |
+ expectTestsPass('currentSchedule.error contains an error passed into ' |
'signalError asynchronously', () { |
- var errors; |
+ var error; |
test('test 1', () { |
currentSchedule.onException.schedule(() { |
- errors = currentSchedule.errors; |
+ error = currentSchedule.error; |
}); |
schedule(() => currentSchedule.signalError('error')); |
}); |
test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), equals(['error'])); |
+ expect(error, new isInstanceOf<ScheduleError>()); |
+ expect(error.error, equals('error')); |
}); |
}, passing: ['test 2']); |
- expectTestsPass('currentSchedule.errors contains an error passed into ' |
+ expectTestsPass('currentSchedule.error contains an error passed into ' |
'signalError out-of-band', () { |
- var errors; |
+ var error; |
test('test 1', () { |
currentSchedule.onException.schedule(() { |
- errors = currentSchedule.errors; |
+ error = currentSchedule.error; |
}); |
sleep(50).then(wrapAsync((_) => currentSchedule.signalError('error'))); |
}); |
test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), equals(['error'])); |
- }); |
- }, passing: ['test 2']); |
- |
- expectTestsPass('currentSchedule.errors contains errors from both the task ' |
- 'queue and the onException queue in onComplete', () { |
- var errors; |
- test('test 1', () { |
- currentSchedule.onComplete.schedule(() { |
- errors = currentSchedule.errors; |
- }); |
- |
- currentSchedule.onException.schedule(() { |
- throw 'error2'; |
- }); |
- |
- throw 'error1'; |
- }); |
- |
- test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), equals(['error1', 'error2'])); |
- }); |
- }, passing: ['test 2']); |
- |
- expectTestsPass('currentSchedule.errors contains multiple out-of-band errors ' |
- 'from both the main task queue and onException in onComplete', () { |
- var errors; |
- test('test 1', () { |
- currentSchedule.onComplete.schedule(() { |
- errors = currentSchedule.errors; |
- }); |
- |
- currentSchedule.onException.schedule(() { |
- sleep(25).then(wrapAsync((_) { |
- throw 'error3'; |
- })); |
- sleep(50).then(wrapAsync((_) { |
- throw 'error4'; |
- })); |
- }); |
- |
- sleep(25).then(wrapAsync((_) { |
- throw 'error1'; |
- })); |
- sleep(50).then(wrapAsync((_) { |
- throw 'error2'; |
- })); |
- }); |
- |
- test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), |
- orderedEquals(['error1', 'error2', 'error3', 'error4'])); |
- }); |
- }, passing: ['test 2']); |
- |
- expectTestsPass('currentSchedule.errors contains both an out-of-band error ' |
- 'and an error raised afterwards in a task', () { |
- var errors; |
- test('test 1', () { |
- currentSchedule.onComplete.schedule(() { |
- errors = currentSchedule.errors; |
- }); |
- |
- sleep(25).then(wrapAsync((_) { |
- throw 'out-of-band'; |
- })); |
- |
- schedule(() => sleep(50).then((_) { |
- throw 'in-band'; |
- })); |
- }); |
- |
- test('test 2', () { |
- expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
- expect(errors.map((e) => e.error), equals(['out-of-band', 'in-band'])); |
+ expect(error, new isInstanceOf<ScheduleError>()); |
+ expect(error.error, equals('error')); |
}); |
}, passing: ['test 2']); |