mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_http_protocol: fix serde_quickcheck_identity_test
Since empty info hash Vec is no longer allowed, don't allow it in test data and expect parsing to succeed.
This commit is contained in:
parent
bb75907c07
commit
df9aaccb46
1 changed files with 15 additions and 6 deletions
|
|
@ -355,13 +355,22 @@ mod tests {
|
|||
#[test]
|
||||
fn quickcheck_serde_identity_request() {
|
||||
fn prop(request: Request) -> TestResult {
|
||||
if let Request::Announce(AnnounceRequest {
|
||||
key: Some(ref key), ..
|
||||
}) = request
|
||||
{
|
||||
if key.len() > 30 {
|
||||
return TestResult::discard();
|
||||
match request {
|
||||
Request::Announce(AnnounceRequest {
|
||||
key: Some(ref key), ..
|
||||
}) => {
|
||||
if key.len() > 30 {
|
||||
return TestResult::discard();
|
||||
}
|
||||
}
|
||||
Request::Scrape(ScrapeRequest {
|
||||
ref info_hashes,
|
||||
}) => {
|
||||
if info_hashes.is_empty() {
|
||||
return TestResult::discard();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
let mut bytes = Vec::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue