Skip to content

Commit a90f095

Browse files
Philippe-Choletphimuemue
authored andcommitted
Test ExactlyOneError specializations
1 parent 5f3cb52 commit a90f095

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/specializations.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,17 @@ quickcheck! {
330330
test_specializations(&it);
331331
test_double_ended_specializations(&it);
332332
}
333+
334+
fn exactly_one_error(v: Vec<u8>) -> TestResult {
335+
// Use `at_most_one` would be similar.
336+
match v.iter().exactly_one() {
337+
Ok(_) => TestResult::discard(),
338+
Err(it) => {
339+
test_specializations(&it);
340+
TestResult::passed()
341+
}
342+
}
343+
}
333344
}
334345

335346
quickcheck! {

0 commit comments

Comments
 (0)