Skip to content

Commit

Permalink
g3-http: add more testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b committed Jan 10, 2024
1 parent 331ff1e commit f44aeca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/g3-http/src/parse/status_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ mod tests {

#[test]
fn no_reason() {
let s = HttpStatusLine::parse(b"HTTP/1.1 200 \r\n").unwrap();
assert_eq!(s.version, 1);
assert_eq!(s.code, 200);
assert_eq!(s.reason, "");
}

#[test]
fn no_reason_no_sp() {
let s = HttpStatusLine::parse(b"HTTP/1.1 200\r\n").unwrap();
assert_eq!(s.version, 1);
assert_eq!(s.code, 200);
Expand Down

0 comments on commit f44aeca

Please sign in to comment.