Skip to content

Commit

Permalink
xdg: Change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Jun 1, 2024
1 parent 962d9c5 commit 6dec1b5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "re_set-lib"
version = "5.1.6"
version = "5.1.7"
edition = "2021"
description = "Data structure library for ReSet"
repository = "https://github.com/Xetibo/ReSet-Lib"
Expand Down
15 changes: 14 additions & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ use crate::{utils::plugin::PluginTestError, utils::plugin::PluginTestFunc};
fn test_config_dir() {
use crate::create_config;
let project_name = "globiTM";
assert!(create_config(project_name).is_some());
let config_file = create_config(project_name);
assert!(config_file.is_some());
let config_file = config_file.unwrap();
let config_file = config_file.to_str().unwrap();
dbg!(&config_file);
assert_eq!(
config_file,
xdg::BaseDirectories::new()
.unwrap()
.get_config_home()
.join("globiTM/ReSet.toml")
.to_str()
.unwrap()
);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/utils/plugin_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static mut LIBS: Vec<libloading::Library> = Vec::new();
pub static mut PLUGIN_DIR: Lazy<PathBuf> = Lazy::new(|| PathBuf::from(""));

static SETUP_PLUGIN_DIR: fn() -> Option<PathBuf> = || -> Option<PathBuf> {
let config = create_config("ReSet").expect("Could not create config directory");
let config = create_config("reset").expect("Could not create config directory");
let plugin_dir = create_dir(config.join("plugins"));
if let Err(error) = plugin_dir {
if error.kind() != ErrorKind::AlreadyExists {
Expand Down

0 comments on commit 6dec1b5

Please sign in to comment.