aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input/unit
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-03-30 20:34:12 +0200
committerGitHub <noreply@github.com>2026-03-30 20:34:12 +0200
commit22ace8e54fbdadd08973854ae7178535a62065b1 (patch)
tree0793eae0b4f0ae379b8cc73fda16ac4b3676e43d /zellij-utils/src/input/unit
parentError on socket paths that are too long (#4957) (diff)
downloadsl0ppij-22ace8e54fbdadd08973854ae7178535a62065b1.tar.gz
sl0ppij-22ace8e54fbdadd08973854ae7178535a62065b1.tar.xz
sl0ppij-22ace8e54fbdadd08973854ae7178535a62065b1.zip
Proper error when providing layout name with a tab (#4958)
* proper error when providing layout name with a tab * rustfmt
Diffstat (limited to 'zellij-utils/src/input/unit')
-rw-r--r--zellij-utils/src/input/unit/layout_test.rs42
1 files changed, 40 insertions, 2 deletions
diff --git a/zellij-utils/src/input/unit/layout_test.rs b/zellij-utils/src/input/unit/layout_test.rs
index 4ba33c12..52b71613 100644
--- a/zellij-utils/src/input/unit/layout_test.rs
+++ b/zellij-utils/src/input/unit/layout_test.rs
@@ -2341,7 +2341,7 @@ fn layout_node_with_multiple_tab_properties() {
}
#[test]
-fn layout_node_with_tab_properties_and_explicit_tabs_errors() {
+fn layout_node_with_name_and_explicit_tabs_errors() {
let kdl_layout = r#"
layout name="test" {
tab {
@@ -2355,7 +2355,45 @@ fn layout_node_with_tab_properties_and_explicit_tabs_errors() {
assert!(layout.is_err());
let error_message = format!("{:?}", layout.unwrap_err());
assert!(error_message.contains(
- "Tab properties on the layout node can only be used when there are no explicit tab nodes"
+ "name' property on the layout node is treated as a tab name and cannot be used when there are explicit tab nodes"
+ ));
+}
+
+#[test]
+fn layout_node_with_split_direction_and_explicit_tabs_errors() {
+ let kdl_layout = r#"
+ layout split_direction="vertical" {
+ tab {
+ pane
+ }
+ }
+ "#;
+
+ let layout = Layout::from_kdl(kdl_layout, Some("layout_file_name".into()), None, None);
+
+ assert!(layout.is_err());
+ let error_message = format!("{:?}", layout.unwrap_err());
+ assert!(error_message.contains(
+ "split_direction' property on the layout node is treated as a tab property and cannot be used when there are explicit tab nodes"
+ ));
+}
+
+#[test]
+fn layout_node_with_hide_floating_panes_and_explicit_tabs_errors() {
+ let kdl_layout = r#"
+ layout hide_floating_panes=true {
+ tab {
+ pane
+ }
+ }
+ "#;
+
+ let layout = Layout::from_kdl(kdl_layout, Some("layout_file_name".into()), None, None);
+
+ assert!(layout.is_err());
+ let error_message = format!("{:?}", layout.unwrap_err());
+ assert!(error_message.contains(
+ "hide_floating_panes' property on the layout node is treated as a tab property and cannot be used when there are explicit tab nodes"
));
}