rustic/tests/config.rs
simonsan 0c7da212df
tests: add test to parse all config files
Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
2024-02-03 10:16:30 +01:00

16 lines
418 B
Rust

//! Configuration file tests
use anyhow::Result;
use rstest::*;
use rustic_rs::RusticConfig;
use std::{fs, path::PathBuf};
/// Ensure all `configs` parse as a valid config files
#[rstest]
fn test_parse_rustic_configs_is_ok(#[files("config/*.toml")] config_path: PathBuf) -> Result<()> {
let toml_string = fs::read_to_string(config_path)?;
let _ = toml::from_str::<RusticConfig>(&toml_string)?;
Ok(())
}