From 27b84796e56a3d3636f6c5741226fbd4ad45fe95 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 11:23:07 -0700 Subject: [PATCH] test(windows): pin the JSON of Container Before the container moves into a shared crate: a test that fixes the serialised form of the Windows Container (id, locked, windows with elements and focused) for an empty container, next to the existing deserialize test, so the move cannot change what `komorebic state` prints. Verified: not run (Windows tests do not run on Linux); type-checked by the Windows clippy gate at the end of this stack. --- komorebi/src/container.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/komorebi/src/container.rs b/komorebi/src/container.rs index baa8f72a..e9116ffd 100644 --- a/komorebi/src/container.rs +++ b/komorebi/src/container.rs @@ -299,6 +299,20 @@ mod tests { assert_eq!(container.focused_window_idx(), 1); } + #[test] + fn the_json_of_a_container_is_its_id_whether_it_is_locked_and_the_ring_of_windows() { + let container = Container { + id: "c1".to_string(), + locked: true, + windows: Default::default(), + }; + + assert_eq!( + serde_json::to_string(&container).unwrap(), + r#"{"id":"c1","locked":true,"windows":{"elements":[],"focused":0}}"# + ); + } + #[test] fn serializes_and_deserializes() { let mut container = Container::default();