forked from notify-rs/notify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ordering of debounced events when multiple files are modified and…
… renamed Closes notify-rs#587
- Loading branch information
Showing
9 changed files
with
327 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
notify-debouncer-full/test_cases/emit_create_event_after_safe_save_and_backup_override.hjson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Based on the Blender safe save scenario. | ||
// | ||
// In this scenario the backup file is not removed first. | ||
{ | ||
state: {} | ||
events: [ | ||
{ kind: "create-any", paths: ["/watch/file@"], time: 1 } | ||
{ kind: "rename-from", paths: ["/watch/file"], tracker: 1, time: 3 } | ||
{ kind: "rename-to", paths: ["/watch/file1"], tracker: 1, time: 4 } | ||
{ kind: "rename-from", paths: ["/watch/file@"], tracker: 2, time: 5 } | ||
{ kind: "rename-to", paths: ["/watch/file"], tracker: 2, time: 6 } | ||
] | ||
expected: { | ||
queues: { | ||
/watch/file: { | ||
events: [ | ||
{ kind: "create-any", paths: ["*"], time: 1 } | ||
] | ||
} | ||
/watch/file1: { | ||
events: [ | ||
{ kind: "rename-both", paths: ["/watch/file", "/watch/file1"], tracker: 1, time: 3 } | ||
] | ||
} | ||
} | ||
events: { | ||
long: [ | ||
{ kind: "rename-both", paths: ["/watch/file", "/watch/file1"], tracker: 1, time: 3 } | ||
{ kind: "create-any", paths: ["/watch/file"], time: 1 } | ||
] | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
notify-debouncer-full/test_cases/emit_create_event_after_safe_save_and_backup_rotation.hjson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// https://github.com/notify-rs/notify/issues/587 | ||
// | ||
// Blender causes the following events when saving a file: | ||
// | ||
// create test.blend@ (new content) | ||
// delete test.blend1 (delete backup) | ||
// rename test.blend -> test.blend1 (move current to backup) | ||
// rename test.blend@ -> test.blend (move new to current) | ||
{ | ||
state: {} | ||
events: [ | ||
{ kind: "create-any", paths: ["/watch/file@"], time: 1 } | ||
{ kind: "remove-any", paths: ["/watch/file1"], time: 2 } | ||
{ kind: "rename-from", paths: ["/watch/file"], tracker: 1, time: 3 } | ||
{ kind: "rename-to", paths: ["/watch/file1"], tracker: 1, time: 4 } | ||
{ kind: "rename-from", paths: ["/watch/file@"], tracker: 2, time: 5 } | ||
{ kind: "rename-to", paths: ["/watch/file"], tracker: 2, time: 6 } | ||
] | ||
expected: { | ||
queues: { | ||
/watch/file: { | ||
events: [ | ||
{ kind: "create-any", paths: ["*"], time: 1 } | ||
] | ||
} | ||
/watch/file1: { | ||
events: [ | ||
{ kind: "remove-any", paths: ["*"], time: 2 } | ||
{ kind: "rename-both", paths: ["/watch/file", "/watch/file1"], tracker: 1, time: 3 } | ||
] | ||
} | ||
} | ||
events: { | ||
long: [ | ||
{ kind: "remove-any", paths: ["/watch/file1"], time: 2 } | ||
{ kind: "rename-both", paths: ["/watch/file", "/watch/file1"], tracker: 1, time: 3 } | ||
{ kind: "create-any", paths: ["/watch/file"], time: 1 } | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.