MCPcopy Create free account
hub / github.com/d0iasm/saba / test_one_header

Function test_one_header

core/src/http.rs:131–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129
130 #[test]
131 fn test_one_header() {
132 let raw = "HTTP/1.1 200 OK\nDate:xx xx xx\n\n".to_string();
133 let res = HttpResponse::new(raw).expect("failed to parse http response");
134 assert_eq!(res.version(), "HTTP/1.1");
135 assert_eq!(res.status_code(), 200);
136 assert_eq!(res.reason(), "OK");
137
138 assert_eq!(res.header_value("Date"), Ok("xx xx xx".to_string()));
139 }
140
141 #[test]
142 fn test_two_headers_with_white_space() {

Callers

nothing calls this directly

Calls 1

to_stringMethod · 0.80

Tested by

no test coverage detected