From acbe816fb4751da3a7d345e7cc5f22acec63da27 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 15:20:14 -0700 Subject: [PATCH] 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). --- crates/komorebi-core/tests/common/mod.rs | 4 ++-- crates/komorebi-core/tests/workspace_containers.rs | 2 +- crates/komorebi-core/tests/workspace_layers.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/komorebi-core/tests/common/mod.rs b/crates/komorebi-core/tests/common/mod.rs index e4d7a748..040e2131 100644 --- a/crates/komorebi-core/tests/common/mod.rs +++ b/crates/komorebi-core/tests/common/mod.rs @@ -281,9 +281,9 @@ impl WorkspacePlatform for StubPlatform { push(format!("note_scrolling_departure {idx}")); } - fn after_floating_removed(workspace: &mut Workspace) { + fn before_floating_removed(workspace: &mut Workspace) { push(format!( - "after_floating_removed len={} focus={}", + "before_floating_removed len={} focus={}", workspace.floating_windows().len(), workspace.focused_floating_window_idx() )); diff --git a/crates/komorebi-core/tests/workspace_containers.rs b/crates/komorebi-core/tests/workspace_containers.rs index a66123f7..9f21ebc9 100644 --- a/crates/komorebi-core/tests/workspace_containers.rs +++ b/crates/komorebi-core/tests/workspace_containers.rs @@ -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); diff --git a/crates/komorebi-core/tests/workspace_layers.rs b/crates/komorebi-core/tests/workspace_layers.rs index 9f376c22..5ea9a5f5 100644 --- a/crates/komorebi-core/tests/workspace_layers.rs +++ b/crates/komorebi-core/tests/workspace_layers.rs @@ -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"]); }