aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-03-17 22:50:03 +0100
committera-kenji <aks.kenji@protonmail.com>2021-03-17 22:50:03 +0100
commit91c109a90245edb3791cd3234787a8a1f6a8f794 (patch)
tree19a6c86f3175dd4651fad026df07c004822ad1b3 /src
parentAdd a clean config option (diff)
downloadsl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.tar.gz
sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.tar.xz
sl0ppij-91c109a90245edb3791cd3234787a8a1f6a8f794.zip
Move test to /unit
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs2
-rw-r--r--src/common/input/config.rs20
-rw-r--r--src/common/input/keybinds.rs2
-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.rs19
5 files changed, 20 insertions, 23 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 740879f0..d4c0f78a 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -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);
-}