chore: fix failing tests
This commit is contained in:
@@ -91,9 +91,9 @@ fn test_build_login_message() {
|
||||
|
||||
let expect: Vec<u8> = [
|
||||
1, 0, 0, 0, 20, 0, 0, 0, 105, 110, 115, 97, 110, 101, 95, 105, 110, 95, 116, 104, 101, 95,
|
||||
98, 114, 97, 105, 110, 50, 8, 0, 0, 0, 49, 51, 51, 55, 53, 49, 51, 55, 160, 0, 0, 0, 32, 0,
|
||||
98, 114, 97, 105, 110, 50, 8, 0, 0, 0, 49, 51, 51, 55, 53, 49, 51, 55, 157, 0, 0, 0, 32, 0,
|
||||
0, 0, 50, 101, 100, 102, 53, 49, 100, 48, 51, 55, 57, 52, 51, 55, 56, 102, 56, 98, 98, 54,
|
||||
51, 49, 48, 100, 52, 54, 48, 99, 50, 50, 98, 49, 17, 0, 0, 0,
|
||||
51, 49, 48, 100, 52, 54, 48, 99, 50, 50, 98, 49, 100, 0, 0, 0,
|
||||
]
|
||||
.to_vec();
|
||||
|
||||
@@ -106,14 +106,8 @@ fn test_build_login_message() {
|
||||
fn test_build_file_search_message() {
|
||||
let message = MessageFactory::build_file_search_message(12, "trance wax");
|
||||
let expect: Vec<u8> = [
|
||||
26, 0, 0, 0, 199, 19, 251, 66, 10, 0, 0, 0, 116, 114, 97, 110, 99, 101, 32, 119, 97, 120,
|
||||
26, 0, 0, 0, 12, 0, 0, 0, 10, 0, 0, 0, 116, 114, 97, 110, 99, 101, 32, 119, 97, 120,
|
||||
]
|
||||
.to_vec();
|
||||
|
||||
// [
|
||||
// 26, 0, 0, 0, 116, 111, 107, 101, 110, 113, 117, 101, 114, 121, 0, 0, 0, 113, 117, 101, 114,
|
||||
// 121,
|
||||
// ]
|
||||
// .to_vec();
|
||||
assert_eq!(expect, message.get_data())
|
||||
}
|
||||
|
||||
+1
-2
@@ -387,7 +387,6 @@ pub fn deflate(data: Vec<u8>) -> Result<Vec<u8>, String> {
|
||||
let mut output: Vec<u8> = vec![];
|
||||
let header_data = reader.read_bytes(16).unwrap();
|
||||
let header = extract_header(&header_data).unwrap();
|
||||
dbg!(header);
|
||||
|
||||
// Main loop to process all blocks in the stream.
|
||||
loop {
|
||||
@@ -1175,5 +1174,5 @@ fn test_deflate() {
|
||||
]
|
||||
.to_vec();
|
||||
let deflated = deflate(data).unwrap();
|
||||
assert_eq!(res, expected)
|
||||
assert_eq!(deflated, expected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user