query string test

This commit is contained in:
Martin Algesten
2018-06-17 00:25:40 +02:00
parent 6b63aab605
commit 9514bd2743
8 changed files with 76 additions and 41 deletions

View File

@@ -14,6 +14,19 @@ fn content_length_on_str() {
assert!(s.contains("\r\nContent-Length: 14\r\n"));
}
#[test]
fn user_set_content_length_on_str() {
test::set_handler("/user_set_content_length_on_str", |_req, _url| {
test::make_response(200, "OK", vec![], vec![])
});
let resp = get("test://host/user_set_content_length_on_str")
.set("Content-Length", "12345")
.send_str("Hello World!!!");
let vec = resp.to_write_vec();
let s = String::from_utf8_lossy(&vec);
assert!(s.contains("\r\nContent-Length: 12345\r\n"));
}
#[test]
fn content_length_on_json() {
test::set_handler("/content_length_on_json", |_req, _url| {