refactor: move inline tests to separate files via #[path]

This commit is contained in:
2026-05-12 16:39:58 +02:00
parent 00218366da
commit 763d622601
58 changed files with 3267 additions and 3267 deletions

View File

@@ -62,22 +62,5 @@ fn build_local_store(path: &str) -> anyhow::Result<Arc<dyn ObjectStore>> {
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn local_store_creates_dir_and_succeeds() {
let dir = std::env::temp_dir().join(format!("image_test_{}", uuid::Uuid::new_v4()));
let result = build_local_store(dir.to_str().unwrap());
assert!(result.is_ok(), "expected Ok, got: {:?}", result.err());
assert!(dir.exists(), "directory should have been created");
}
#[test]
fn local_store_succeeds_if_dir_already_exists() {
let dir = std::env::temp_dir().join(format!("image_test_{}", uuid::Uuid::new_v4()));
std::fs::create_dir_all(&dir).unwrap();
let result = build_local_store(dir.to_str().unwrap());
assert!(result.is_ok());
}
}
#[path = "tests/config.rs"]
mod tests;