use assert_cmd::Command;
use predicates::str::contains;
use std::fs;
use std::path::Path;
fn aristo_in(dir: &Path) -> Command {
let mut cmd = Command::cargo_bin("aristo").unwrap();
cmd.current_dir(dir);
cmd
}
#[test]
fn audit_strict_passes_when_only_unverified() {
let tmp = tempfile::tempdir().unwrap();
aristo_in(tmp.path()).arg("init").assert().success();
fs::create_dir_all(tmp.path().join("src")).unwrap();
fs::write(
tmp.path().join("src/lib.rs"),
r#"#[aristo::intent("a claim", verify = "neural", id = "p1")] fn x() -> i32 { 1 }"#,
)
.unwrap();
fs::remove_file(tmp.path().join(".aristo/index.toml")).unwrap();
aristo_in(tmp.path())
.args(["verify", "--audit", "--strict"])
.assert()
.success()
.stdout(contains("unknown (unverified): 1"));
}
#[test]
fn audit_strict_fails_on_orphan_proof() {
let tmp = tempfile::tempdir().unwrap();
aristo_in(tmp.path()).arg("init").assert().success();
let proofs = tmp.path().join(".aristo/proofs");
fs::create_dir_all(&proofs).unwrap();
fs::write(proofs.join("ghost.proof"), "verdict = {}\n").unwrap();
aristo_in(tmp.path())
.args(["verify", "--audit", "--strict"])
.assert()
.failure()
.code(1)
.stderr(contains("orphan proof"));
}