diff options
| author | a-kenji <aks.kenji@protonmail.com> | 2021-03-17 22:50:03 +0100 |
|---|---|---|
| committer | a-kenji <aks.kenji@protonmail.com> | 2021-03-17 22:50:03 +0100 |
| commit | 91c109a90245edb3791cd3234787a8a1f6a8f794 (patch) | |
| tree | 19a6c86f3175dd4651fad026df07c004822ad1b3 /src | |
| parent | Add a clean config option (diff) | |
| download | sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.tar.gz sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.tar.xz sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.zip | |
Move test to /unit
Diffstat (limited to 'src')
| -rw-r--r-- | src/cli.rs | 2 | ||||
| -rw-r--r-- | src/common/input/config.rs | 20 | ||||
| -rw-r--r-- | src/common/input/keybinds.rs | 2 | ||||
| -rw-r--r-- | src/common/input/unit/keybinds_test.rs (renamed from src/common/input/ut/keybinds_test.rs) | 0 | ||||
| -rw-r--r-- | src/common/input/ut/config_test.rs | 19 |
5 files changed, 20 insertions, 23 deletions
@@ -1,7 +1,7 @@ use std::path::PathBuf; use structopt::StructOpt; -#[derive(StructOpt, Debug)] +#[derive(StructOpt, Default, Debug)] #[structopt(name = "zellij")] pub struct CliArgs { /// Send "split (direction h == horizontal / v == vertical)" to active zellij session diff --git a/src/common/input/config.rs b/src/common/input/config.rs index 668b4106..7d804d68 100644 --- a/src/common/input/config.rs +++ b/src/common/input/config.rs @@ -122,5 +122,21 @@ impl From<serde_yaml::Error> for ConfigError { // The unit test location. #[cfg(test)] -#[path = "./ut/config_test.rs"] -mod config_test; +mod config_test { + use super::*; + + #[test] + fn no_config_file_equals_default_config() { + let no_file = PathBuf::from(r"../fixtures/config/config.yamlll"); + let config = Config::from_option_or_default(Some(no_file)).unwrap(); + let default = Config::default(); + assert_eq!(config, default); + } + + #[test] + fn no_config_option_file_equals_default_config() { + let config = Config::from_option_or_default(None).unwrap(); + let default = Config::default(); + assert_eq!(config, default); + } +} diff --git a/src/common/input/keybinds.rs b/src/common/input/keybinds.rs index 0c37693c..c70123b6 100644 --- a/src/common/input/keybinds.rs +++ b/src/common/input/keybinds.rs @@ -368,5 +368,5 @@ impl From<KeyActionFromYaml> for ModeKeybinds { // The unit test location. #[cfg(test)] -#[path = "./ut/keybinds_test.rs"] +#[path = "./unit/keybinds_test.rs"] mod keybinds_test; diff --git a/src/common/input/ut/keybinds_test.rs b/src/common/input/unit/keybinds_test.rs index 2b306bc3..2b306bc3 100644 --- a/src/common/input/ut/keybinds_test.rs +++ b/src/common/input/unit/keybinds_test.rs diff --git a/src/common/input/ut/config_test.rs b/src/common/input/ut/config_test.rs deleted file mode 100644 index eb4bc960..00000000 --- a/src/common/input/ut/config_test.rs +++ /dev/null @@ -1,19 +0,0 @@ -//! For Configuration Options - -use super::super::config::*; -use std::path::PathBuf; - -#[test] -fn no_config_file_equals_default_config() { - let no_file = PathBuf::from(r"../fixtures/config/config.yamlll"); - let config = Config::from_option_or_default(Some(no_file)).unwrap(); - let default = Config::default(); - assert_eq!(config, default); -} - -#[test] -fn no_config_option_file_equals_default_config() { - let config = Config::from_option_or_default(None).unwrap(); - let default = Config::default(); - assert_eq!(config, default); -} |
