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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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, everyElement(new isInstanceOf<ScheduleError>())); |
74 expect(errors.length, equals(1)); | 74 expect(errors.length, equals(1)); |
75 expect(errors.first.error, | 75 expect(errors.first.error.toString(), |
76 matches(r"^File not found: '[^']+[\\/]name\.txt'\.$")); | 76 matches(r"^File not found: '[^']+[\\/]name\.txt'\.$")); |
77 }); | 77 }); |
Bill Hesse
2013/09/23 17:15:25
Should we even just drop the length check, and wri
nweiz
2013/09/23 22:14:34
I like this idea (probably with two checks rather
| |
78 }, passing: ['test 2']); | 78 }, passing: ['test 2']); |
79 | 79 |
80 expectTestsPass("async().validate() forwards to directory().validate", () { | 80 expectTestsPass("async().validate() forwards to directory().validate", () { |
81 test('test', () { | 81 test('test', () { |
82 scheduleSandbox(); | 82 scheduleSandbox(); |
83 | 83 |
84 d.dir('dir', [ | 84 d.dir('dir', [ |
85 d.file('file1.txt', 'contents1'), | 85 d.file('file1.txt', 'contents1'), |
86 d.file('file2.txt', 'contents2') | 86 d.file('file2.txt', 'contents2') |
87 ]).create(); | 87 ]).create(); |
(...skipping 20 matching lines...) Expand all Loading... | |
108 return d.dir('dir', [ | 108 return d.dir('dir', [ |
109 d.file('file1.txt', 'contents1'), | 109 d.file('file1.txt', 'contents1'), |
110 d.file('file2.txt', 'contents2') | 110 d.file('file2.txt', 'contents2') |
111 ]); | 111 ]); |
112 })).validate(); | 112 })).validate(); |
113 }); | 113 }); |
114 | 114 |
115 test('test 2', () { | 115 test('test 2', () { |
116 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 116 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
117 expect(errors.length, equals(1)); | 117 expect(errors.length, equals(1)); |
118 expect(errors.first.error, | 118 expect(errors.first.error.toString(), |
119 matches(r"^Directory not found: '[^']+[\\/]dir'\.$")); | 119 matches(r"^Directory not found: '[^']+[\\/]dir'\.$")); |
120 }); | 120 }); |
121 }, passing: ['test 2']); | 121 }, passing: ['test 2']); |
122 } | 122 } |
OLD | NEW |