mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic http protocol: fix failure response serialization test failure
This commit is contained in:
parent
d36f97f272
commit
e88ecec9c7
1 changed files with 11 additions and 3 deletions
|
|
@ -143,6 +143,7 @@ impl ScrapeResponse {
|
|||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FailureResponse {
|
||||
#[serde(rename = "failure reason")]
|
||||
pub failure_reason: String,
|
||||
}
|
||||
|
||||
|
|
@ -318,10 +319,17 @@ mod tests {
|
|||
&Response::Failure(response.clone())
|
||||
).unwrap();
|
||||
|
||||
let mut output = Vec::new();
|
||||
let mut hand_written = Vec::new();
|
||||
|
||||
response.write(&mut output).unwrap();
|
||||
response.write(&mut hand_written).unwrap();
|
||||
|
||||
output == reference
|
||||
let success = hand_written == reference;
|
||||
|
||||
if !success {
|
||||
println!("reference: {}", String::from_utf8_lossy(&reference));
|
||||
println!("hand_written: {}", String::from_utf8_lossy(&hand_written));
|
||||
}
|
||||
|
||||
success
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue