OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'dart:async'; |
| 6 import 'dart:io'; |
| 7 |
| 8 import 'package:scheduled_test/scheduled_test.dart'; |
| 9 |
| 10 import '../metatest.dart'; |
| 11 import '../utils.dart'; |
| 12 |
| 13 void main() { |
| 14 setUpTimeout(); |
| 15 |
| 16 expectTestsPass('currentSchedule.state starts out as SET_UP', () { |
| 17 test('test', () { |
| 18 expect(currentSchedule.state, equals(ScheduleState.SET_UP)); |
| 19 }); |
| 20 }); |
| 21 |
| 22 expectTestsPass('currentSchedule.state is RUNNING in tasks', () { |
| 23 test('test', () { |
| 24 schedule(() { |
| 25 expect(currentSchedule.state, equals(ScheduleState.RUNNING)); |
| 26 }); |
| 27 |
| 28 currentSchedule.onComplete.schedule(() { |
| 29 expect(currentSchedule.state, equals(ScheduleState.RUNNING)); |
| 30 }); |
| 31 }); |
| 32 }); |
| 33 |
| 34 expectTestsPass('currentSchedule.state is DONE after the test', () { |
| 35 var oldSchedule; |
| 36 test('test 1', () { |
| 37 oldSchedule = currentSchedule; |
| 38 }); |
| 39 |
| 40 test('test 2', () { |
| 41 expect(oldSchedule.state, equals(ScheduleState.DONE)); |
| 42 }); |
| 43 }); |
| 44 } |
OLD | NEW |