Skip to content

Commit

Permalink
add display test
Browse files Browse the repository at this point in the history
  • Loading branch information
jedireza committed Jan 2, 2024
1 parent e09dda5 commit 909fc7d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,28 @@ mod raw_tests {

assert!(Record::<EmptyBody>::try_from(headers).is_err());
}

#[test]
fn verify_display() {
let headers = RawRecordHeader {
version: "1.0".to_owned(),
headers: vec![
(WarcHeader::WarcType, b"dunno".to_vec()),
(WarcHeader::Date, b"2024-01-01T00:00:00Z".to_vec()),
]
.into_iter()
.collect(),
};

let expected = "\
WARC/1.0\n\
warc-type: dunno\n\
warc-date: 2024-01-01T00:00:00Z\n\
\n\
";

assert_eq!(headers.to_string(), expected);
}
}

#[cfg(test)]
Expand Down

0 comments on commit 909fc7d

Please sign in to comment.