Move test to /unit
This commit is contained in:
parent
e64192b42e
commit
91c109a902
5 changed files with 20 additions and 23 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
|
||||||
#[derive(StructOpt, Debug)]
|
#[derive(StructOpt, Default, Debug)]
|
||||||
#[structopt(name = "zellij")]
|
#[structopt(name = "zellij")]
|
||||||
pub struct CliArgs {
|
pub struct CliArgs {
|
||||||
/// Send "split (direction h == horizontal / v == vertical)" to active zellij session
|
/// Send "split (direction h == horizontal / v == vertical)" to active zellij session
|
||||||
|
|
|
||||||
|
|
@ -122,5 +122,21 @@ impl From<serde_yaml::Error> for ConfigError {
|
||||||
|
|
||||||
// The unit test location.
|
// The unit test location.
|
||||||
#[cfg(test)]
|
#[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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -368,5 +368,5 @@ impl From<KeyActionFromYaml> for ModeKeybinds {
|
||||||
|
|
||||||
// The unit test location.
|
// The unit test location.
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[path = "./ut/keybinds_test.rs"]
|
#[path = "./unit/keybinds_test.rs"]
|
||||||
mod keybinds_test;
|
mod keybinds_test;
|
||||||
|
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue