File tree Expand file tree Collapse file tree 3 files changed +17
-30
lines changed
pkgs/watcher/test/directory_watcher Expand file tree Collapse file tree 3 files changed +17
-30
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,23 @@ void fileTests() {
291291 })));
292292 });
293293
294+ test (
295+ 'emits events for many nested files moved out then immediately back in' ,
296+ () async {
297+ withPermutations (
298+ (i, j, k) => writeFile ('dir/sub/sub-$i /sub-$j /file-$k .txt' ));
299+
300+ await startWatcher (path: 'dir' );
301+
302+ renameDir ('dir/sub' , 'sub' );
303+ renameDir ('sub' , 'dir/sub' );
304+
305+ await inAnyOrder (withPermutations (
306+ (i, j, k) => isRemoveEvent ('dir/sub/sub-$i /sub-$j /file-$k .txt' )));
307+ await inAnyOrder (withPermutations (
308+ (i, j, k) => isAddEvent ('dir/sub/sub-$i /sub-$j /file-$k .txt' )));
309+ });
310+
294311 test (
295312 'emits events for many files added at once in a subdirectory with the '
296313 'same name as a removed file' , () async {
Original file line number Diff line number Diff line change @@ -22,19 +22,4 @@ void main() {
2222 test ('DirectoryWatcher creates a LinuxDirectoryWatcher on Linux' , () {
2323 expect (DirectoryWatcher ('.' ), const TypeMatcher <LinuxDirectoryWatcher >());
2424 });
25-
26- test ('emits events for many nested files moved out then immediately back in' ,
27- () async {
28- withPermutations (
29- (i, j, k) => writeFile ('dir/sub/sub-$i /sub-$j /file-$k .txt' ));
30- await startWatcher (path: 'dir' );
31-
32- renameDir ('dir/sub' , 'sub' );
33- renameDir ('sub' , 'dir/sub' );
34-
35- await inAnyOrder (withPermutations (
36- (i, j, k) => isRemoveEvent ('dir/sub/sub-$i /sub-$j /file-$k .txt' )));
37- await inAnyOrder (withPermutations (
38- (i, j, k) => isAddEvent ('dir/sub/sub-$i /sub-$j /file-$k .txt' )));
39- });
4025}
Original file line number Diff line number Diff line change @@ -36,21 +36,6 @@ void main() {
3636 await expectAddEvent ('dir/newer.txt' );
3737 });
3838
39- test ('emits events for many nested files moved out then immediately back in' ,
40- () async {
41- withPermutations (
42- (i, j, k) => writeFile ('dir/sub/sub-$i /sub-$j /file-$k .txt' ));
43-
44- await startWatcher (path: 'dir' );
45-
46- renameDir ('dir/sub' , 'sub' );
47- renameDir ('sub' , 'dir/sub' );
48-
49- await inAnyOrder (withPermutations (
50- (i, j, k) => isRemoveEvent ('dir/sub/sub-$i /sub-$j /file-$k .txt' )));
51- await inAnyOrder (withPermutations (
52- (i, j, k) => isAddEvent ('dir/sub/sub-$i /sub-$j /file-$k .txt' )));
53- });
5439 test ('does not suppress files with the same prefix as a directory' , () async {
5540 // Regression test for https://github.com/dart-lang/watcher/issues/83
5641 writeFile ('some_name.txt' );
You can’t perform that action at this time.
0 commit comments