[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:
@@ -40,6 +40,12 @@ macro_rules! assert_too_large {
|
||||
};
|
||||
}
|
||||
|
||||
/// False for `Err(Unimplemented)`. "Never panics" properties assert this on every result, so they cannot pass
|
||||
/// against a stub that returns `Unimplemented` for everything.
|
||||
pub fn implemented<T>(r: &domistream::Result<T>) -> bool {
|
||||
!matches!(r, Err(domistream::Error::Unimplemented))
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------ randomness
|
||||
|
||||
/// A seeded, deterministic random source (splitmix64). Never for production.
|
||||
|
||||
Reference in New Issue
Block a user