Index: pkg/watcher/test/directory_watcher/shared.dart |
diff --git a/pkg/watcher/test/directory_watcher/shared.dart b/pkg/watcher/test/directory_watcher/shared.dart |
index eed606931c5804b7f5ffa0a705ee998c30dcef5a..34b5e6284d3b872a32ef519b46b7b0c82a80fd4d 100644 |
--- a/pkg/watcher/test/directory_watcher/shared.dart |
+++ b/pkg/watcher/test/directory_watcher/shared.dart |
@@ -6,6 +6,8 @@ import 'package:scheduled_test/scheduled_test.dart'; |
import '../utils.dart'; |
+import 'dart:async'; |
+ |
sharedTests() { |
test('does not notify for files that already exist when started', () { |
// Make some pre-existing files. |
@@ -218,5 +220,21 @@ sharedTests() { |
}); |
}); |
}); |
+ |
+ test("emits events for many files added at once in a subdirectory with the " |
+ "same name as a removed file", () { |
+ writeFile("dir/sub"); |
+ withPermutations((i, j, k) => |
+ writeFile("old/sub-$i/sub-$j/file-$k.txt")); |
+ startWatcher(dir: "dir"); |
+ |
+ deleteFile("dir/sub"); |
+ renameDir("old", "dir/sub"); |
+ inAnyOrder(() { |
+ expectRemoveEvent("dir/sub"); |
+ withPermutations((i, j, k) => |
+ expectAddEvent("dir/sub/sub-$i/sub-$j/file-$k.txt")); |
+ }); |
+ }); |
}); |
} |