Add custom function for unit test in zellij-utils

This commit is contained in:
Kunal Mohan 2021-07-04 21:16:47 +05:30
parent 82288c6a3d
commit e2949509a2

View File

@ -12,6 +12,7 @@ const CONFIG_LOCATION: &str = ".config/zellij";
const CONFIG_NAME: &str = "config.yaml";
static ARROW_SEPARATOR: &str = "";
#[cfg(not(test))]
/// Goes through a predefined list and checks for an already
/// existing config directory, returns the first match
pub fn find_default_config_dir() -> Option<PathBuf> {
@ -22,6 +23,11 @@ pub fn find_default_config_dir() -> Option<PathBuf> {
.flatten()
}
#[cfg(test)]
pub fn find_default_config_dir() -> Option<PathBuf> {
None
}
/// Order in which config directories are checked
fn default_config_dirs() -> Vec<Option<PathBuf>> {
vec![