[domistream] Tests: properties cannot pass against Unimplemented
The never-panic properties (XML, RTSP, ENet, control, input, media) and the allocation-cap checks only asserted inside `if let Ok`, so a stub returning Unimplemented for everything passed them. Each now also requires the parser to answer something other than Unimplemented (common::implemented); the XML truncation property wants Malformed or Truncated, not any error.
This commit is contained in:
@@ -450,7 +450,9 @@ proptest! {
|
||||
/// Arbitrary bytes never panic; whatever parses re-encodes to an equal event.
|
||||
#[test]
|
||||
fn parse_is_stable(data in proptest::collection::vec(any::<u8>(), 0..64)) {
|
||||
if let Ok(e) = parse_input(&data) {
|
||||
let parsed = parse_input(&data);
|
||||
prop_assert!(common::implemented(&parsed));
|
||||
if let Ok(e) = parsed {
|
||||
let again = encode_input(&e).map_err(|err| TestCaseError::fail(format!("{err:?}")))?;
|
||||
prop_assert_eq!(parse_input(&again), Ok(e));
|
||||
}
|
||||
@@ -459,6 +461,6 @@ proptest! {
|
||||
/// Valid framing around random data of every known type never panics.
|
||||
#[test]
|
||||
fn framed_random_data(code in prop_oneof![Just(3u32), Just(4), Just(5), Just(7), Just(8), Just(9), Just(0x0A), Just(0x0C), Just(0x5500_0001), Just(0x5500_0004)], data in proptest::collection::vec(any::<u8>(), 0..40)) {
|
||||
let _ = parse_input(&input_message(code, &data));
|
||||
prop_assert!(common::implemented(&parse_input(&input_message(code, &data))));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user