From 87b1f50b396414f4df642636ed0168c84bbc9c0e Mon Sep 17 00:00:00 2001 From: "andy.boot" Date: Thu, 5 Aug 2021 16:22:07 +0100 Subject: [PATCH] Tests: Refactor: Neaten --- tests/test_exact_output.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_exact_output.rs b/tests/test_exact_output.rs index 29c3db4..1e7b0cb 100644 --- a/tests/test_exact_output.rs +++ b/tests/test_exact_output.rs @@ -56,11 +56,9 @@ fn run_dust_with>(params: Vec) -> String { } fn check_dust_output(output: String, func: fn() -> Vec) { - let mut we_match = false; - for mo in func() { - we_match = we_match || output.contains(&mo); - } - assert!(we_match); + assert!(func() + .iter() + .fold(false, |sum, i| sum || output.contains(i))); } // "windows" result data can vary by host (size seems to be variable by one byte); fix code vs test and re-enable