From 87b6455612936fb4177758c550a3ecff21197e4d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 9 Oct 2026 14:20:50 +0200 Subject: [PATCH] Test that a PipelineRefusal read as text names its variant and parts Kills the one cargo-mutants survivor on eureka-pipeline (Display::fmt replaced by Ok(Default::default())). Co-Authored-By: Claude Opus 5.5 --- crates/eureka-pipeline/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/eureka-pipeline/src/lib.rs b/crates/eureka-pipeline/src/lib.rs index 7bd75f3..fbf5c83 100644 --- a/crates/eureka-pipeline/src/lib.rs +++ b/crates/eureka-pipeline/src/lib.rs @@ -2772,6 +2772,18 @@ mod tests { Ok(()) } + /// A refusal read as text names its variant and its parts, so an operator + /// who sees only the message (a log line, an `anyhow` chain) can tell which + /// field was refused and why. + #[test] + fn a_refusal_read_as_text_names_its_variant_and_parts() { + let text = PipelineRefusal::FieldBound { field: "title".into(), limit: 200, actual: 201 }.to_string(); + assert!(text.starts_with("pipeline refusal: "), "{text}"); + for part in ["FieldBound", "title", "200", "201"] { + assert!(text.contains(part), "{part} is missing from {text}"); + } + } + /// The catalogue is exactly the files beside it: every entry's `path` is a /// schema file in the directory, and every schema file in the directory /// has an entry, so a schema removed from the catalogue (or a file left