use salvor::prelude::*;
#[tokio::test]
async fn the_prelude_opens_a_real_store_and_reads_back_an_unknown_run() {
let dir = tempfile::tempdir().expect("tempdir");
let store = SqliteStore::open(dir.path().join("facade.db")).expect("open the store");
let run = RunId::new();
let log = store.read_log(run).await.expect("read an unknown run");
assert!(
log.is_empty(),
"a run with no appended events reads back empty, got {} events",
log.len()
);
}
#[test]
fn the_fold_is_reachable_and_calls_an_empty_log_not_started() {
let empty: Vec<EventEnvelope> = Vec::new();
let state: RunState = derive_state(&empty);
assert!(
matches!(state.status, RunStatus::NotStarted),
"an empty log folds to NotStarted, got {:?}",
state.status
);
}
#[test]
fn the_documented_module_paths_resolve() {
let _: fn() -> salvor::runtime::AgentBuilder = salvor::runtime::Agent::builder;
let _: salvor::tools::RetryPolicy = salvor::tools::RetryPolicy::for_effect(Effect::Read);
let _: u32 = salvor::core::SCHEMA_VERSION;
}