mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vfs] fixes missed notifications on flat file watch root changes on macOS (IDEA-165018)
This commit is contained in:
@@ -144,7 +144,6 @@ class CanonicalPathMap {
|
||||
String rootParent = new File(root).getParent();
|
||||
if (rootParent != null && FileUtil.namesEqual(path, rootParent)) {
|
||||
changedPaths.add(root);
|
||||
continue ext;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,7 +157,6 @@ class CanonicalPathMap {
|
||||
String rootParent = new File(root).getParent();
|
||||
if (rootParent != null && FileUtil.namesEqual(path, rootParent)) {
|
||||
changedPaths.add(root);
|
||||
continue ext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,23 +119,23 @@ class FileWatcherTest : BareTestFixtureTestCase() {
|
||||
}
|
||||
|
||||
@Test fun testFileRoot() {
|
||||
val file = tempDir.newFile("test.txt")
|
||||
refresh(file)
|
||||
val files = arrayOf(tempDir.newFile("test1.txt"), tempDir.newFile("test2.txt"))
|
||||
files.forEach { refresh(it) }
|
||||
files.forEach { watch(it, false) }
|
||||
|
||||
watch(file, false)
|
||||
assertEvents({ file.writeText("new content") }, mapOf(file to 'U'))
|
||||
assertEvents({ file.delete() }, mapOf(file to 'D'))
|
||||
assertEvents({ file.writeText("re-creation") }, mapOf(file to 'C'))
|
||||
assertEvents({ files.forEach { it.writeText("new content") } }, files.map { it to 'U' }.toMap())
|
||||
assertEvents({ files.forEach { it.delete() } }, files.map { it to 'D' }.toMap())
|
||||
assertEvents({ files.forEach { it.writeText("re-creation") } }, files.map { it to 'C' }.toMap())
|
||||
}
|
||||
|
||||
@Test fun testFileRootRecursive() {
|
||||
val file = tempDir.newFile("test.txt")
|
||||
refresh(file)
|
||||
val files = arrayOf(tempDir.newFile("test1.txt"), tempDir.newFile("test2.txt"))
|
||||
files.forEach { refresh(it) }
|
||||
files.forEach { watch(it, true) }
|
||||
|
||||
watch(file, true)
|
||||
assertEvents({ file.writeText("new content") }, mapOf(file to 'U'))
|
||||
assertEvents({ file.delete() }, mapOf(file to 'D'))
|
||||
assertEvents({ file.writeText("re-creation") }, mapOf(file to 'C'))
|
||||
assertEvents({ files.forEach { it.writeText("new content") } }, files.map { it to 'U' }.toMap())
|
||||
assertEvents({ files.forEach { it.delete() } }, files.map { it to 'D' }.toMap())
|
||||
assertEvents({ files.forEach { it.writeText("re-creation") } }, files.map { it to 'C' }.toMap())
|
||||
}
|
||||
|
||||
@Test fun testNonCanonicallyNamedFileRoot() {
|
||||
|
||||
Reference in New Issue
Block a user