warning: in the working copy of 'crates/spt/tests/common/reap.rs', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of 'crates/spt/tests/fixtures/gh_fixture.rs', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of 'crates/spt/tests/fixtures/git_fixture.rs', LF will be replaced by CRLF the next time Git touches it warning: in the working copy of 'crates/spt/tests/json_emit.rs', LF will be replaced by CRLF the next time Git touches it diff --git a/crates/spt/tests/common/reap.rs b/crates/spt/tests/common/reap.rs index 7e84d63..bc9f9ad 100644 --- a/crates/spt/tests/common/reap.rs +++ b/crates/spt/tests/common/reap.rs @@ -146,7 +146,10 @@ pub fn authenticated_kill( return refuse("gone", "the breadcrumb outlived its writer".to_string()) } ProcIdentity::Unproven => { - return refuse("unproven-identity", "no creation time to compare".to_string()) + return refuse( + "unproven-identity", + "no creation time to compare".to_string(), + ) } ProcIdentity::Present(started_at) => started_at, }; @@ -154,7 +157,10 @@ pub fn authenticated_kill( if obs.started_at != started_at { return refuse( "reused", - format!("observed_started_at={} current={started_at}", obs.started_at), + format!( + "observed_started_at={} current={started_at}", + obs.started_at + ), ); } } diff --git a/crates/spt/tests/fixtures/gh_fixture.rs b/crates/spt/tests/fixtures/gh_fixture.rs index 1e6a497..43d7bd9 100644 --- a/crates/spt/tests/fixtures/gh_fixture.rs +++ b/crates/spt/tests/fixtures/gh_fixture.rs @@ -35,7 +35,11 @@ fn main() { if let Ok(log) = std::env::var("SPT_FAKE_GH_LOG") { use std::io::Write; - if let Ok(mut f) = std::fs::OpenOptions::new().create(true).append(true).open(&log) { + if let Ok(mut f) = std::fs::OpenOptions::new() + .create(true) + .append(true) + .open(&log) + { let _ = writeln!(f, "gh {}", args.join(" ")); } } diff --git a/crates/spt/tests/fixtures/git_fixture.rs b/crates/spt/tests/fixtures/git_fixture.rs index aedf05c..b797ebe 100644 --- a/crates/spt/tests/fixtures/git_fixture.rs +++ b/crates/spt/tests/fixtures/git_fixture.rs @@ -12,7 +12,11 @@ fn main() { let args: Vec = std::env::args().skip(1).collect(); if let Ok(log) = std::env::var("SPT_GIT_SHIM_LOG") { use std::io::Write; - if let Ok(mut f) = std::fs::OpenOptions::new().create(true).append(true).open(&log) { + if let Ok(mut f) = std::fs::OpenOptions::new() + .create(true) + .append(true) + .open(&log) + { let _ = writeln!(f, "git {}", args.join(" ")); } } diff --git a/crates/spt/tests/json_emit.rs b/crates/spt/tests/json_emit.rs index a1fb2dc..57385dc 100644 --- a/crates/spt/tests/json_emit.rs +++ b/crates/spt/tests/json_emit.rs @@ -24,7 +24,11 @@ use spt_store::perch; /// Run `spt --json` under the isolated home, bounded so a wedged /// subprocess fails loud instead of hanging the suite. -fn run_json(spt_bin: &std::path::Path, home: &std::path::Path, args: &[&str]) -> std::process::Output { +fn run_json( + spt_bin: &std::path::Path, + home: &std::path::Path, + args: &[&str], +) -> std::process::Output { let mut cmd = Command::new(spt_bin); cmd.no_window() .args(args) @@ -45,7 +49,10 @@ fn run_json(spt_bin: &std::path::Path, home: &std::path::Path, args: &[&str]) -> fn parse_json(label: &str, out: &std::process::Output) -> serde_json::Value { let stdout = String::from_utf8_lossy(&out.stdout); let stderr = String::from_utf8_lossy(&out.stderr); - eprintln!("=== {label} --json ===\nstatus={}\nstdout=\n{stdout}\nstderr=\n{stderr}", out.status); + eprintln!( + "=== {label} --json ===\nstatus={}\nstdout=\n{stdout}\nstderr=\n{stderr}", + out.status + ); serde_json::from_str::(stdout.trim()).unwrap_or_else(|e| { panic!("{label} --json must emit parseable JSON, got non-JSON ({e}): stdout=\n{stdout}") }) @@ -90,7 +97,11 @@ fn json_flag_emits_parseable_json_for_read_status_subset() { // ── how-to (bare) → the topic list DTO ── let out = run_json(&spt_bin, home.path(), &["how-to"]); - assert!(out.status.success(), "how-to --json should exit 0: {:?}", out); + assert!( + out.status.success(), + "how-to --json should exit 0: {:?}", + out + ); let v = parse_json("how-to", &out); assert!( v.get("topics").map(|t| t.is_array()).unwrap_or(false), @@ -99,7 +110,11 @@ fn json_flag_emits_parseable_json_for_read_status_subset() { // ── adapter version → {adapter, version} DTO ── let out = run_json(&spt_bin, home.path(), &["adapter", "version", "cc"]); - assert!(out.status.success(), "adapter version --json should exit 0: {:?}", out); + assert!( + out.status.success(), + "adapter version --json should exit 0: {:?}", + out + ); let v = parse_json("adapter version", &out); assert_eq!( v.get("version").and_then(|s| s.as_str()), @@ -109,7 +124,11 @@ fn json_flag_emits_parseable_json_for_read_status_subset() { // ── daemon status → the status DTO (running=false here; still valid JSON) ── let out = run_json(&spt_bin, home.path(), &["daemon", "status"]); - assert!(out.status.success(), "daemon status --json should exit 0: {:?}", out); + assert!( + out.status.success(), + "daemon status --json should exit 0: {:?}", + out + ); let v = parse_json("daemon status", &out); assert!( v.get("running").map(|r| r.is_boolean()).unwrap_or(false), @@ -127,7 +146,10 @@ fn json_flag_emits_parseable_json_for_read_status_subset() { ("adapter list", ["adapter", "list"], "adapters"), ] { let out = run_json(&spt_bin, home.path(), &argv); - assert!(out.status.success(), "{label} --json should exit 0: {out:?}"); + assert!( + out.status.success(), + "{label} --json should exit 0: {out:?}" + ); let v = parse_json(label, &out); assert!( v.get(key).map(|a| a.is_array()).unwrap_or(false),