mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +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]
|
#[test]
|
||||||
fn quickcheck_serde_identity_request() {
|
fn quickcheck_serde_identity_request() {
|
||||||
fn prop(request: Request) -> TestResult {
|
fn prop(request: Request) -> TestResult {
|
||||||
if let Request::Announce(AnnounceRequest {
|
match request {
|
||||||
key: Some(ref key), ..
|
Request::Announce(AnnounceRequest {
|
||||||
}) = request
|
key: Some(ref key), ..
|
||||||
{
|
}) => {
|
||||||
if key.len() > 30 {
|
if key.len() > 30 {
|
||||||
return TestResult::discard();
|
return TestResult::discard();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Request::Scrape(ScrapeRequest {
|
||||||
|
ref info_hashes,
|
||||||
|
}) => {
|
||||||
|
if info_hashes.is_empty() {
|
||||||
|
return TestResult::discard();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::new();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue