28 lines
660 B
Rust
28 lines
660 B
Rust
use std::path::PathBuf;
|
|
|
|
use fomod_manager::types::RootConfig;
|
|
|
|
fn get_parent() -> PathBuf {
|
|
PathBuf::from(file!()).parent().unwrap().to_owned()
|
|
}
|
|
|
|
fn load_root() -> RootConfig {
|
|
RootConfig::load_from_file(get_parent().join("data/root_config_complex.toml")).unwrap()
|
|
}
|
|
|
|
#[test]
|
|
fn export_gamefiles() {
|
|
let root_config = load_root();
|
|
|
|
let game = root_config.game_by_id("sse").expect("No game found");
|
|
|
|
let links = game.export_links().expect("Failed to export game links");
|
|
|
|
assert!(
|
|
links.iter().all(|e| e.src().is_absolute()),
|
|
"Link src is not absolute"
|
|
);
|
|
|
|
assert_eq!(links.len(), 4, "Not all files linked");
|
|
}
|