Skip to content

Commit

Permalink
Move test to /unit
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kenji committed Mar 17, 2021
1 parent e64192b commit 91c109a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 18 additions & 2 deletions src/common/input/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/common/input/keybinds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
File renamed without changes.
19 changes: 0 additions & 19 deletions src/common/input/ut/config_test.rs

This file was deleted.

0 comments on commit 91c109a

Please sign in to comment.