diff options
Diffstat (limited to 'zellij-utils/src/input/unit')
-rw-r--r-- | zellij-utils/src/input/unit/layout_test.rs | 47 | ||||
-rw-r--r-- | zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap | 134 |
2 files changed, 102 insertions, 79 deletions
diff --git a/zellij-utils/src/input/unit/layout_test.rs b/zellij-utils/src/input/unit/layout_test.rs index 424a5b22d..b2070ce1e 100644 --- a/zellij-utils/src/input/unit/layout_test.rs +++ b/zellij-utils/src/input/unit/layout_test.rs @@ -551,29 +551,29 @@ fn layout_with_plugin_panes() { TiledPaneLayout { children: vec![ TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { location: RunPluginLocation::Zellij(PluginTag::new("tab-bar")), _allow_exec_host_cmd: false, configuration: Default::default(), - })), + }))), ..Default::default() }, TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { location: RunPluginLocation::File(PathBuf::from( "/path/to/my/plugin.wasm", )), _allow_exec_host_cmd: false, configuration: Default::default(), - })), + }))), ..Default::default() }, TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { location: RunPluginLocation::Zellij(PluginTag::new("status-bar")), _allow_exec_host_cmd: false, configuration: PluginUserConfiguration(expected_plugin_configuration), - })), + }))), ..Default::default() }, ], @@ -2079,6 +2079,9 @@ fn run_plugin_location_parsing() { pane { plugin location="file:c:/absolute/windows/plugin.wasm" } + pane { + plugin location="filepicker" + } } "#; let layout = Layout::from_kdl(kdl_layout, "layout_file_name".into(), None, None).unwrap(); @@ -2087,59 +2090,67 @@ fn run_plugin_location_parsing() { TiledPaneLayout { children: vec![ TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::Zellij(PluginTag::new("tab-bar")), configuration: Default::default(), - })), + }))), ..Default::default() }, TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from( "/path/to/my/plugin.wasm", )), configuration: Default::default(), - })), + }))), ..Default::default() }, TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from("plugin.wasm")), configuration: Default::default(), - })), + }))), ..Default::default() }, TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from( "relative/with space/plugin.wasm", )), configuration: Default::default(), - })), + }))), ..Default::default() }, TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from( "/absolute/with space/plugin.wasm", )), configuration: Default::default(), - })), + }))), ..Default::default() }, TiledPaneLayout { - run: Some(Run::Plugin(RunPlugin { + run: Some(Run::Plugin(RunPluginOrAlias::RunPlugin(RunPlugin { _allow_exec_host_cmd: false, location: RunPluginLocation::File(PathBuf::from( "c:/absolute/windows/plugin.wasm", )), configuration: Default::default(), - })), + }))), + ..Default::default() + }, + TiledPaneLayout { + run: Some(Run::Plugin(RunPluginOrAlias::Alias(PluginAlias { + name: "filepicker".to_owned(), + configuration: Some(PluginUserConfiguration::default()), + ..Default::default() + }))), ..Default::default() }, ], diff --git a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap index 0ebdf2ca2..abfd8801b 100644 --- a/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap +++ b/zellij-utils/src/input/unit/snapshots/zellij_utils__input__layout__layout_test__can_load_swap_layouts_from_a_different_file.snap @@ -1,6 +1,6 @@ --- source: zellij-utils/src/input/./unit/layout_test.rs -assertion_line: 1880 +assertion_line: 1935 expression: "format!(\"{:#?}\", layout)" --- Layout { @@ -65,17 +65,19 @@ Layout { ), run: Some( Plugin( - RunPlugin { - _allow_exec_host_cmd: false, - location: Zellij( - PluginTag( - "tab-bar", + RunPlugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "tab-bar", + ), ), - ), - configuration: PluginUserConfiguration( - {}, - ), - }, + configuration: PluginUserConfiguration( + {}, + ), + }, + ), ), ), borderless: true, @@ -167,17 +169,19 @@ Layout { ), run: Some( Plugin( - RunPlugin { - _allow_exec_host_cmd: false, - location: Zellij( - PluginTag( - "status-bar", + RunPlugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "status-bar", + ), + ), + configuration: PluginUserConfiguration( + {}, ), - ), - configuration: PluginUserConfiguration( - {}, - ), - }, + }, + ), ), ), borderless: true, @@ -220,17 +224,19 @@ Layout { ), run: Some( Plugin( - RunPlugin { - _allow_exec_host_cmd: false, - location: Zellij( - PluginTag( - "tab-bar", + RunPlugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "tab-bar", + ), + ), + configuration: PluginUserConfiguration( + {}, ), - ), - configuration: PluginUserConfiguration( - {}, - ), - }, + }, + ), ), ), borderless: true, @@ -387,17 +393,19 @@ Layout { ), run: Some( Plugin( - RunPlugin { - _allow_exec_host_cmd: false, - location: Zellij( - PluginTag( - "status-bar", + RunPlugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "status-bar", + ), ), - ), - configuration: PluginUserConfiguration( - {}, - ), - }, + configuration: PluginUserConfiguration( + {}, + ), + }, + ), ), ), borderless: true, @@ -440,17 +448,19 @@ Layout { ), run: Some( Plugin( - RunPlugin { - _allow_exec_host_cmd: false, - location: Zellij( - PluginTag( - "tab-bar", + RunPlugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "tab-bar", + ), + ), + configuration: PluginUserConfiguration( + {}, ), - ), - configuration: PluginUserConfiguration( - {}, - ), - }, + }, + ), ), ), borderless: true, @@ -688,17 +698,19 @@ Layout { ), run: Some( Plugin( - RunPlugin { - _allow_exec_host_cmd: false, - location: Zellij( - PluginTag( - "status-bar", + RunPlugin( + RunPlugin { + _allow_exec_host_cmd: false, + location: Zellij( + PluginTag( + "status-bar", + ), + ), + configuration: PluginUserConfiguration( + {}, ), - ), - configuration: PluginUserConfiguration( - {}, - ), - }, + }, + ), ), ), borderless: true, |