From 7393ea6dd48abb88273ac38ab87e8689501004bb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 7 Oct 2022 17:25:39 +0100 Subject: [PATCH] arti config exhaust checking: Improve message, add comment I had a failure that was confusing to me, and I wrote it... --- crates/arti/src/cfg.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/arti/src/cfg.rs b/crates/arti/src/cfg.rs index c196a1b81..b5f268474 100644 --- a/crates/arti/src/cfg.rs +++ b/crates/arti/src/cfg.rs @@ -643,9 +643,11 @@ mod test { .map(|(path, m)| format!(" config key {:?}: {}", path, m)) .collect_vec(); + // If this assert fails, it might be because in `fn exhaustive`, below, + // a newly-defined config item has not been added to the list for OLDEST_SUPPORTED_CONFIG. assert! { problems.is_empty(), - "example config exhaustiveness check failed for {:?}:\n{}\n", - example_file, problems.join("\n")} + "example config exhaustiveness check failed: {}\n-----8<-----\n{}\n-----8<-----\n", + problems.join("\n"), example_file} } #[test]