Skip to content

Commit

Permalink
Test ExactlyOneError specializations
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Dec 15, 2023
1 parent 3377c3c commit 5835a90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/specializations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,17 @@ quickcheck! {
test_specializations(&it);
test_double_ended_specializations(&it);
}

fn exactly_one_error(v: Vec<u8>) -> TestResult {
// Use `at_most_one` would be similar.
match v.iter().exactly_one() {
Ok(_) => TestResult::discard(),
Err(it) => {
test_specializations(&it);
TestResult::passed()
}
}
}
}

quickcheck! {
Expand Down

0 comments on commit 5835a90

Please sign in to comment.