Chromium Code Reviews| 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, new isInstanceOf<TestFailure>()); |
|
nweiz
2013/09/20 21:45:41
The type of this exception isn't an important part
Bill Hesse
2013/09/23 17:15:25
Done.
| |
| 76 matches(r"^File not found: '[^']+[\\/]name\.txt'\.$")); | 76 expect(errors.first.error.message, |
|
nweiz
2013/09/20 21:45:41
In keeping with the above, we should test [error.t
Bill Hesse
2013/09/23 17:15:25
Done.
| |
| 77 matches(r"^File not found: '[^']+[\\/]name\.txt'\.$")); | |
| 77 }); | 78 }); |
| 78 }, passing: ['test 2']); | 79 }, passing: ['test 2']); |
| 79 | 80 |
| 80 expectTestsPass("async().validate() forwards to directory().validate", () { | 81 expectTestsPass("async().validate() forwards to directory().validate", () { |
| 81 test('test', () { | 82 test('test', () { |
| 82 scheduleSandbox(); | 83 scheduleSandbox(); |
| 83 | 84 |
| 84 d.dir('dir', [ | 85 d.dir('dir', [ |
| 85 d.file('file1.txt', 'contents1'), | 86 d.file('file1.txt', 'contents1'), |
| 86 d.file('file2.txt', 'contents2') | 87 d.file('file2.txt', 'contents2') |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 108 return d.dir('dir', [ | 109 return d.dir('dir', [ |
| 109 d.file('file1.txt', 'contents1'), | 110 d.file('file1.txt', 'contents1'), |
| 110 d.file('file2.txt', 'contents2') | 111 d.file('file2.txt', 'contents2') |
| 111 ]); | 112 ]); |
| 112 })).validate(); | 113 })).validate(); |
| 113 }); | 114 }); |
| 114 | 115 |
| 115 test('test 2', () { | 116 test('test 2', () { |
| 116 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); | 117 expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
| 117 expect(errors.length, equals(1)); | 118 expect(errors.length, equals(1)); |
| 118 expect(errors.first.error, | 119 expect(errors.first.error, new isInstanceOf<TestFailure>()); |
| 120 expect(errors.first.error.message, | |
| 119 matches(r"^Directory not found: '[^']+[\\/]dir'\.$")); | 121 matches(r"^Directory not found: '[^']+[\\/]dir'\.$")); |
| 120 }); | 122 }); |
| 121 }, passing: ['test 2']); | 123 }, passing: ['test 2']); |
| 122 } | 124 } |
| OLD | NEW |