forked from lavina/lavina
1
0
Fork 0

Compare commits

..

No commits in common. "eb34ac65ae43fc23b146e4f747abb0ffe7633519" and "22c58484cc5c842215af3225c2d5ed47b36602b3" have entirely different histories.

1 changed files with 8 additions and 0 deletions

View File

@ -79,6 +79,10 @@ mod test {
fn test_fail_if_size_less_then_3() { fn test_fail_if_size_less_then_3() {
let orig = b"login\x00pass"; let orig = b"login\x00pass";
let encoded = general_purpose::STANDARD.encode(orig); let encoded = general_purpose::STANDARD.encode(orig);
let expected = AuthBody {
login: "login".to_string(),
password: "pass".to_string(),
};
let result = AuthBody::from_str(encoded.as_bytes()); let result = AuthBody::from_str(encoded.as_bytes());
assert!(result.is_err()); assert!(result.is_err());
@ -88,6 +92,10 @@ mod test {
fn test_fail_if_size_greater_then_3() { fn test_fail_if_size_greater_then_3() {
let orig = b"first\x00login\x00pass\x00other"; let orig = b"first\x00login\x00pass\x00other";
let encoded = general_purpose::STANDARD.encode(orig); let encoded = general_purpose::STANDARD.encode(orig);
let expected = AuthBody {
login: "login".to_string(),
password: "pass".to_string(),
};
let result = AuthBody::from_str(encoded.as_bytes()); let result = AuthBody::from_str(encoded.as_bytes());
assert!(result.is_err()); assert!(result.is_err());