aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/ipc/tests
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-03-30 16:02:09 +0200
committerGitHub <noreply@github.com>2026-03-30 16:02:09 +0200
commit8ce05f0bbd58acbbca95f95ae14fdc4e866f7391 (patch)
tree57c6d9ee2231a556f938df4f2629511a711518df /zellij-utils/src/ipc/tests
parentdocs(changelog): recent windows fixes (diff)
downloadsl0ppij-8ce05f0bbd58acbbca95f95ae14fdc4e866f7391.tar.gz
sl0ppij-8ce05f0bbd58acbbca95f95ae14fdc4e866f7391.tar.xz
sl0ppij-8ce05f0bbd58acbbca95f95ae14fdc4e866f7391.zip
Layout string flag (#4956)
* allow sending a stringified layout with --layout-string * add --tab-id to all the things * fix windows tests * add pr
Diffstat (limited to 'zellij-utils/src/ipc/tests')
-rw-r--r--zellij-utils/src/ipc/tests/roundtrip_tests.rs181
1 files changed, 179 insertions, 2 deletions
diff --git a/zellij-utils/src/ipc/tests/roundtrip_tests.rs b/zellij-utils/src/ipc/tests/roundtrip_tests.rs
index cfe882a1..7ef7ac89 100644
--- a/zellij-utils/src/ipc/tests/roundtrip_tests.rs
+++ b/zellij-utils/src/ipc/tests/roundtrip_tests.rs
@@ -1,8 +1,8 @@
use super::test_framework::*;
use crate::data::{
BareKey, CommandOrPlugin, ConnectToSession, Direction, FloatingPaneCoordinates, InputMode,
- KeyModifier, KeyWithModifier, LayoutInfo, LayoutMetadata, OriginatingPlugin, PaneId, PluginTag,
- Resize, WebSharing,
+ KeyModifier, KeyWithModifier, LayoutInfo, LayoutMetadata, NewPanePlacement, OriginatingPlugin,
+ PaneId, PluginTag, Resize, WebSharing,
};
use crate::input::actions::{Action, SearchDirection, SearchOption};
use crate::input::cli_assets::CliAssets;
@@ -1054,6 +1054,7 @@ fn test_client_messages() {
start_suppressed: false,
coordinates: None,
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1078,6 +1079,7 @@ fn test_client_messages() {
start_suppressed: false,
coordinates: None,
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1102,6 +1104,7 @@ fn test_client_messages() {
start_suppressed: false,
coordinates: None,
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1126,6 +1129,7 @@ fn test_client_messages() {
start_suppressed: true,
coordinates: FloatingPaneCoordinates::new(None, None, None, None, None, Some(false)),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1157,6 +1161,7 @@ fn test_client_messages() {
Some(false),
),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1188,6 +1193,7 @@ fn test_client_messages() {
Some(false),
),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1219,6 +1225,7 @@ fn test_client_messages() {
Some(false),
),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1250,6 +1257,7 @@ fn test_client_messages() {
Some(false)
),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1261,6 +1269,7 @@ fn test_client_messages() {
pane_name: None,
coordinates: None,
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1288,6 +1297,7 @@ fn test_client_messages() {
Some(false),
),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1319,6 +1329,7 @@ fn test_client_messages() {
Some(false),
),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1331,6 +1342,7 @@ fn test_client_messages() {
pane_name: None,
near_current_pane: false,
borderless: None,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1356,6 +1368,7 @@ fn test_client_messages() {
pane_name: Some("my_pane_name".to_owned()),
near_current_pane: false,
borderless: Some(true),
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1381,6 +1394,7 @@ fn test_client_messages() {
near_current_pane: false,
pane_id_to_replace: None,
close_replaced_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1393,6 +1407,7 @@ fn test_client_messages() {
near_current_pane: false,
pane_id_to_replace: None,
close_replaced_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1416,6 +1431,7 @@ fn test_client_messages() {
}),
pane_name: Some("my_pane_name".to_owned()),
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -1426,6 +1442,7 @@ fn test_client_messages() {
command: None,
pane_name: None,
near_current_pane: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2230,6 +2247,7 @@ fn test_client_messages() {
should_open_in_place: true,
close_replaced_pane: false,
skip_cache: true,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2244,6 +2262,7 @@ fn test_client_messages() {
should_open_in_place: false,
close_replaced_pane: false,
skip_cache: false,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2258,6 +2277,7 @@ fn test_client_messages() {
close_replaced_pane: false,
skip_cache: true,
cwd: None,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2272,6 +2292,7 @@ fn test_client_messages() {
close_replaced_pane: false,
skip_cache: false,
cwd: Some(PathBuf::from("/path/to/cwd")),
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2438,6 +2459,7 @@ fn test_client_messages() {
pane_name: Some("my_pane_name".to_owned()),
skip_cache: false,
cwd: Some(PathBuf::from("relative/path/to/cwd")),
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2450,6 +2472,7 @@ fn test_client_messages() {
skip_cache: true,
cwd: Some(PathBuf::from("relative/path/to/cwd")),
coordinates: None,
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2469,6 +2492,7 @@ fn test_client_messages() {
Some(true),
Some(false),
),
+ tab_id: None,
},
terminal_id: Some(1),
client_id: Some(100),
@@ -2480,6 +2504,159 @@ fn test_client_messages() {
pane_name: Some("my_pane_name".to_owned()),
skip_cache: true,
close_replaced_pane: false,
+ tab_id: None,
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ // tab_id roundtrip tests - verify tab_id survives serialization
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewTiledPane {
+ direction: Some(Direction::Right),
+ command: None,
+ pane_name: None,
+ near_current_pane: false,
+ borderless: None,
+ tab_id: Some(3),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewFloatingPane {
+ command: None,
+ pane_name: None,
+ coordinates: None,
+ near_current_pane: false,
+ tab_id: Some(5),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewStackedPane {
+ command: None,
+ pane_name: None,
+ near_current_pane: false,
+ tab_id: Some(2),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewBlockingPane {
+ placement: NewPanePlacement::Tiled {
+ direction: None,
+ borderless: None
+ },
+ pane_name: None,
+ command: None,
+ unblock_condition: None,
+ near_current_pane: false,
+ tab_id: Some(1),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::EditFile {
+ payload: OpenFilePayload {
+ path: PathBuf::from("/file/path"),
+ line_number: None,
+ cwd: None,
+ originating_plugin: None,
+ },
+ direction: None,
+ floating: false,
+ in_place: false,
+ close_replaced_pane: false,
+ start_suppressed: false,
+ coordinates: None,
+ near_current_pane: false,
+ tab_id: Some(4),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewInPlacePane {
+ command: None,
+ pane_name: None,
+ near_current_pane: false,
+ pane_id_to_replace: None,
+ close_replaced_pane: false,
+ tab_id: Some(7),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::LaunchOrFocusPlugin {
+ plugin: RunPluginOrAlias::RunPlugin(RunPlugin::default()),
+ should_float: true,
+ move_to_focused_tab: false,
+ should_open_in_place: false,
+ close_replaced_pane: false,
+ skip_cache: false,
+ tab_id: Some(2),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::LaunchPlugin {
+ plugin: RunPluginOrAlias::RunPlugin(RunPlugin::default()),
+ should_float: false,
+ should_open_in_place: false,
+ close_replaced_pane: false,
+ skip_cache: false,
+ cwd: None,
+ tab_id: Some(6),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewTiledPluginPane {
+ plugin: RunPluginOrAlias::RunPlugin(RunPlugin::default()),
+ pane_name: None,
+ skip_cache: false,
+ cwd: None,
+ tab_id: Some(1),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewFloatingPluginPane {
+ plugin: RunPluginOrAlias::RunPlugin(RunPlugin::default()),
+ pane_name: None,
+ skip_cache: false,
+ cwd: None,
+ coordinates: None,
+ tab_id: Some(3),
+ },
+ terminal_id: Some(1),
+ client_id: Some(100),
+ is_cli_client: true,
+ });
+ test_client_roundtrip!(ClientToServerMsg::Action {
+ action: Action::NewInPlacePluginPane {
+ plugin: RunPluginOrAlias::RunPlugin(RunPlugin::default()),
+ pane_name: None,
+ skip_cache: false,
+ close_replaced_pane: false,
+ tab_id: Some(2),
},
terminal_id: Some(1),
client_id: Some(100),