From 5835a90f726e4e9a42a82f7d6b20aef8ac85f740 Mon Sep 17 00:00:00 2001 From: Philippe-Cholet Date: Fri, 15 Dec 2023 19:06:04 +0100 Subject: [PATCH] Test `ExactlyOneError` specializations --- tests/specializations.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/specializations.rs b/tests/specializations.rs index abe41fe92..e14b1b669 100644 --- a/tests/specializations.rs +++ b/tests/specializations.rs @@ -330,6 +330,17 @@ quickcheck! { test_specializations(&it); test_double_ended_specializations(&it); } + + fn exactly_one_error(v: Vec) -> TestResult { + // Use `at_most_one` would be similar. + match v.iter().exactly_one() { + Ok(_) => TestResult::discard(), + Err(it) => { + test_specializations(&it); + TestResult::passed() + } + } + } } quickcheck! {