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/descriptor.dart' as d; | 7 import 'package:scheduled_test/descriptor.dart' as d; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../metatest.dart'; | 10 import '../metatest.dart'; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 currentSchedule.onException.schedule(() { | 63 currentSchedule.onException.schedule(() { |
64 errors = currentSchedule.errors; | 64 errors = currentSchedule.errors; |
65 }); | 65 }); |
66 | 66 |
67 d.async(pumpEventQueue().then((_) { | 67 d.async(pumpEventQueue().then((_) { |
68 return d.file('name.txt', 'contents'); | 68 return d.file('name.txt', 'contents'); |
69 })).validate(); | 69 })).validate(); |
70 }); | 70 }); |
71 | 71 |
72 test('test 2', () { | 72 test('test 2', () { |
73 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 73 expect(errors.single, new isInstanceOf<ScheduleError>()); |
74 expect(errors.length, equals(1)); | 74 expect(errors.single.error.toString(), |
75 expect(errors.first.error, | 75 matches(r"^File not found: '[^']+[\\/]name\.txt'\.$")); |
76 matches(r"^File not found: '[^']+[\\/]name\.txt'\.$")); | |
77 }); | 76 }); |
78 }, passing: ['test 2']); | 77 }, passing: ['test 2']); |
79 | 78 |
80 expectTestsPass("async().validate() forwards to directory().validate", () { | 79 expectTestsPass("async().validate() forwards to directory().validate", () { |
81 test('test', () { | 80 test('test', () { |
82 scheduleSandbox(); | 81 scheduleSandbox(); |
83 | 82 |
84 d.dir('dir', [ | 83 d.dir('dir', [ |
85 d.file('file1.txt', 'contents1'), | 84 d.file('file1.txt', 'contents1'), |
86 d.file('file2.txt', 'contents2') | 85 d.file('file2.txt', 'contents2') |
(...skipping 19 matching lines...) Expand all Loading... |
106 | 105 |
107 d.async(pumpEventQueue().then((_) { | 106 d.async(pumpEventQueue().then((_) { |
108 return d.dir('dir', [ | 107 return d.dir('dir', [ |
109 d.file('file1.txt', 'contents1'), | 108 d.file('file1.txt', 'contents1'), |
110 d.file('file2.txt', 'contents2') | 109 d.file('file2.txt', 'contents2') |
111 ]); | 110 ]); |
112 })).validate(); | 111 })).validate(); |
113 }); | 112 }); |
114 | 113 |
115 test('test 2', () { | 114 test('test 2', () { |
116 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 115 expect(errors.single, new isInstanceOf<ScheduleError>()); |
117 expect(errors.length, equals(1)); | 116 expect(errors.single.error.toString(), |
118 expect(errors.first.error, | |
119 matches(r"^Directory not found: '[^']+[\\/]dir'\.$")); | 117 matches(r"^Directory not found: '[^']+[\\/]dir'\.$")); |
120 }); | 118 }); |
121 }, passing: ['test 2']); | 119 }, passing: ['test 2']); |
122 } | 120 } |
OLD | NEW |