OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
6 | 6 |
7 import 'utils.dart'; | 7 import 'utils.dart'; |
8 | 8 |
9 main() { | 9 main() { |
10 initConfig(); | 10 initConfig(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 writeFile("a.txt", contents: "after", updateModified: false); | 79 writeFile("a.txt", contents: "after", updateModified: false); |
80 writeFile("b.txt", contents: "after"); | 80 writeFile("b.txt", contents: "after"); |
81 expectModifyEvent("b.txt"); | 81 expectModifyEvent("b.txt"); |
82 }); | 82 }); |
83 | 83 |
84 test('watches files in subdirectories', () { | 84 test('watches files in subdirectories', () { |
85 createWatcher(); | 85 createWatcher(); |
86 writeFile("a/b/c/d/file.txt"); | 86 writeFile("a/b/c/d/file.txt"); |
87 expectAddEvent("a/b/c/d/file.txt"); | 87 expectAddEvent("a/b/c/d/file.txt"); |
88 }); | 88 }); |
| 89 |
| 90 test('watches a directory created after the watcher', () { |
| 91 // Watch a subdirectory that doesn't exist yet. |
| 92 createWatcher(dir: "a"); |
| 93 |
| 94 // This implicity creates it. |
| 95 writeFile("a/b/c/d/file.txt"); |
| 96 expectAddEvent("a/b/c/d/file.txt"); |
| 97 }); |
| 98 |
| 99 test('when the watched directory is deleted, removes all files', () { |
| 100 writeFile("dir/a.txt"); |
| 101 writeFile("dir/b.txt"); |
| 102 |
| 103 createWatcher(dir: "dir"); |
| 104 |
| 105 deleteDir("dir"); |
| 106 expectRemoveEvents(["dir/a.txt", "dir/b.txt"]); |
| 107 }); |
89 } | 108 } |
OLD | NEW |