mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-16 13:51:19 +01:00
test(core): follow the rename of the floating-window hook to before_floating_removed
wip-u-coretests (written against the hook's old name after_floating_removed) and wip-u-core4 (which renamed it to before_floating_removed because it runs before the window leaves the ring) were merged in candidate 5; the stub platform and the expected hook logs now use the new name. No behaviour change: the order test already pinned 'before the removal'. Verified: cargo test -p komorebi-core (with and without the schemars feature).
This commit is contained in:
1 parent
ba094355d4
commit
acbe816fb4
3 files changed
+5
-5
No files matched your search
@@ -281,9 +281,9 @@ impl WorkspacePlatform for StubPlatform {
|
||||
push(format!("note_scrolling_departure {idx}"));
|
||||
}
|
||||
|
||||
fn after_floating_removed(workspace: &mut Workspace<Self>) {
|
||||
fn before_floating_removed(workspace: &mut Workspace<Self>) {
|
||||
push(format!(
|
||||
"after_floating_removed len={} focus={}",
|
||||
"before_floating_removed len={} focus={}",
|
||||
workspace.floating_windows().len(),
|
||||
workspace.focused_floating_window_idx()
|
||||
));
|
||||
|
||||
@@ -701,7 +701,7 @@ fn the_hooks_a_platform_does_not_override_do_nothing_to_the_workspace() {
|
||||
workspace.floating_windows_mut().push_back(w(6));
|
||||
workspace.focus_floating_window(1);
|
||||
|
||||
// the stub overrides after_floating_removed only to log: the focus index is the workspace's
|
||||
// the stub overrides before_floating_removed only to log: the focus index is the workspace's
|
||||
// own business, and the default platform of the other tests keeps it
|
||||
workspace.remove_floating_window(6);
|
||||
assert_eq!(workspace.focused_floating_window_idx(), 1);
|
||||
|
||||
@@ -284,7 +284,7 @@ fn a_floating_window_is_removed_by_id_and_the_hook_runs_before_it_goes() {
|
||||
let removed = workspace.remove_floating_window(8).unwrap();
|
||||
|
||||
assert_eq!(removed.id, 8);
|
||||
assert_eq!(log(), ["after_floating_removed len=2 focus=0"]);
|
||||
assert_eq!(log(), ["before_floating_removed len=2 focus=0"]);
|
||||
assert!(workspace.remove_floating_window(8).is_none());
|
||||
// nothing is logged for a window that is not there
|
||||
assert!(log().is_empty());
|
||||
@@ -530,5 +530,5 @@ fn the_floating_removal_hook_runs_before_the_window_is_taken_out() {
|
||||
|
||||
// pins today's order (the KDE and macOS order): the hook sees both windows and the old
|
||||
// focus, although the trait doc says "after a floating window was taken out"
|
||||
assert_eq!(log(), ["after_floating_removed len=2 focus=1"]);
|
||||
assert_eq!(log(), ["before_floating_removed len=2 focus=1"]);
|
||||
}
|
||||
Reference in new issue
Block a user