Skip to content

Commit b877ff5

Browse files
committed
Add test instructions.
1 parent 7286622 commit b877ff5

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"files.associations": {},
3+
"editor.wordWrap": "on"
4+
}

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ ADDRESS_WITH_PORT - Can be IP address or a domain name. ( example 127.0.0.1:3000
1313
PATH_TO_FILE - Absoulte path to the file, including preceding slash. ( example / or /public/file.bin )
1414
```
1515

16+
# Sample Files
17+
18+
A file `2-mb-file.txt` is in the repo for self hosting. Otherwise, checkout http://xcal1.vodafone.co.uk/.
19+
1620
# License
1721

1822
This software is licensed under GNU General Public License v3.0 or later.

src/http_message.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ mod tests {
4242
#[test]
4343
fn parse_raw_message() {
4444
let http_message =
45-
"HTTP/1.1 200 OK\r\nAccept-Ranges: bytes\r\n Content-Length: 100\r\n\r\nSome content.\nAnd some more.";
45+
"HTTP/1.1 200 OK\r\nAccept-Ranges: bytes\r\nContent-Length: 100\r\n\r\nSome content.\nAnd some more.";
4646

4747
let message = HTTPMessage::new(http_message);
4848
let message_str = format!("{:?}", message);
49-
let expected_message_str = r#"HTTPMessage { start_line: "HTTP/1.1 200 OK", headers: {"Accept-Ranges": "bytes", " Content-Length": "100"}, body: [83, 111, 109, 101, 32, 99, 111, 110, 116, 101, 110, 116, 46, 10, 65, 110, 100, 32, 115, 111, 109, 101, 32, 109, 111, 114, 101, 46] }"#;
49+
let expected_message_str = r#"HTTPMessage { start_line: "HTTP/1.1 200 OK", headers: {"Content-Length": "100", "Accept-Ranges": "bytes"}, body: [83, 111, 109, 101, 32, 99, 111, 110, 116, 101, 110, 116, 46, 10, 65, 110, 100, 32, 115, 111, 109, 101, 32, 109, 111, 114, 101, 46] }"#;
5050

5151
assert_eq!(message_str, expected_message_str);
5252
}

0 commit comments

Comments
 (0)