aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/setup.rs
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-05-02 18:46:36 +0200
committera-kenji <aks.kenji@protonmail.com>2021-05-02 18:58:18 +0200
commit3f3d10e63606604ccc3b751a7cf2a27bb52292d0 (patch)
treeb016902cd4771ce5b4d86da7771e832c72c150c4 /src/common/setup.rs
parentdocs(changelog): Add theme support through xrdb #239 (diff)
downloadsl0ppij-3f3d10e63606604ccc3b751a7cf2a27bb52292d0.tar.gz
sl0ppij-3f3d10e63606604ccc3b751a7cf2a27bb52292d0.tar.xz
sl0ppij-3f3d10e63606604ccc3b751a7cf2a27bb52292d0.zip
Enables the Default Config Test
The split of test/no_test happens now in find_config_dir, it always returns Null in tests. That way differing configurations in tests shouldn't make the test fail anymore.
Diffstat (limited to 'src/common/setup.rs')
-rw-r--r--src/common/setup.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/setup.rs b/src/common/setup.rs
index 9d1e7d19..70e0ded4 100644
--- a/src/common/setup.rs
+++ b/src/common/setup.rs
@@ -48,6 +48,7 @@ pub mod install {
}
}
+#[cfg(not(test))]
pub fn find_default_config_dir() -> Option<PathBuf> {
vec![
Some(xdg_config_dir()),
@@ -60,6 +61,11 @@ pub fn find_default_config_dir() -> Option<PathBuf> {
.flatten()
}
+#[cfg(test)]
+pub fn find_default_config_dir() -> Option<PathBuf> {
+ None
+}
+
pub fn xdg_config_dir() -> PathBuf {
let project_dirs = ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
project_dirs.config_dir().to_owned()