aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/input/unit/snapshots
diff options
context:
space:
mode:
authorRan Shaham <shahamran@users.noreply.github.com>2023-04-28 17:45:08 +0300
committerGitHub <noreply@github.com>2023-04-28 16:45:08 +0200
commitb640270804ed6d7235645d796cec0553de5b7121 (patch)
treecdf49188afe786c5ad1baf86c7739ba170888f1d /zellij-utils/src/input/unit/snapshots
parentdocs(changelog): update and render plugins async (diff)
downloadsl0ppij-b640270804ed6d7235645d796cec0553de5b7121.tar.gz
sl0ppij-b640270804ed6d7235645d796cec0553de5b7121.tar.xz
sl0ppij-b640270804ed6d7235645d796cec0553de5b7121.zip
feat(layout): Support environment variables in cwd (#2288) (#2291)
* feat(layout): Support environment variables in cwd (#2288) * add `shellexpand` as dependency * expand environment variable in kdl parser's `parse_cwd()` * Fix and enhance environment variable expansion. * Return a proper `ConfigError` on failures. * Replace raw cwd parsing with `parse_cwd()`. * Add tests that verify correct expansions. * Perform env var expansion in more contexts. * feat(layout): Rewrite env var tests as snapshots. * Update layout env var expansion test snapshot.
Diffstat (limited to 'zellij-utils/src/input/unit/snapshots')
-rw-r--r--zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__env_var_expansion.snap212
1 files changed, 212 insertions, 0 deletions
diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__env_var_expansion.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__env_var_expansion.snap
new file mode 100644
index 00000000..de30d229
--- /dev/null
+++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__env_var_expansion.snap
@@ -0,0 +1,212 @@
+---
+source: zellij-utils/src/input/./unit/layout_test.rs
+assertion_line: 2116
+expression: "format!(\"{layout:#?}\")"
+---
+Layout {
+ tabs: [],
+ focused_tab_index: None,
+ template: Some(
+ (
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ Cwd(
+ "/abs/path/relative",
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ Cwd(
+ "/another/abs",
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ Cwd(
+ "/another/abs",
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ Cwd(
+ "/abs/path/relative",
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ Command(
+ RunCommand {
+ command: "ls",
+ args: [],
+ cwd: Some(
+ "/somewhere",
+ ),
+ hold_on_close: true,
+ hold_on_start: false,
+ },
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ EditFile(
+ "/somewhere/file.rs",
+ None,
+ Some(
+ "/somewhere",
+ ),
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ EditFile(
+ "/home/aram/backup/file.rs",
+ None,
+ Some(
+ "/home/aram/backup",
+ ),
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ Command(
+ RunCommand {
+ command: "/home/aram/backup/executable",
+ args: [],
+ cwd: Some(
+ "/abs/path",
+ ),
+ hold_on_close: true,
+ hold_on_start: false,
+ },
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ TiledPaneLayout {
+ children_split_direction: Horizontal,
+ name: None,
+ children: [],
+ split_size: None,
+ run: Some(
+ EditFile(
+ "/home/aram/backup/foo.txt",
+ None,
+ Some(
+ "/abs/path",
+ ),
+ ),
+ ),
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ ],
+ split_size: None,
+ run: None,
+ borderless: false,
+ focus: None,
+ external_children_index: None,
+ children_are_stacked: false,
+ is_expanded_in_stack: false,
+ exclude_from_sync: None,
+ },
+ [],
+ ),
+ ),
+ swap_layouts: [],
+ swap_tiled_layouts: [],
+ swap_floating_layouts: [],
+}