diff --git a/komorebi/src/workspace.rs b/komorebi/src/workspace.rs index fe97a111..10f980df 100644 --- a/komorebi/src/workspace.rs +++ b/komorebi/src/workspace.rs @@ -2291,6 +2291,25 @@ mod tests { assert_eq!(container.windows().len(), 1); } + #[test] + fn test_move_window_to_non_existent_container() { + let mut workspace = Workspace::default(); + + // Add a container with one window + let mut container = Container::default(); + container.windows_mut().push_back(Window::from(1)); + workspace.add_container_to_back(container); + + // Try to move window to a non-existent container + let result = workspace.move_window_to_container(8); + + // Should return an error + assert!( + result.is_err(), + "Expected an error when moving a window to a non-existent container" + ); + } + #[test] fn test_remove_window() { let mut workspace = Workspace::default();