forked from lavina/lavina
Compare commits
No commits in common. "eb34ac65ae43fc23b146e4f747abb0ffe7633519" and "22c58484cc5c842215af3225c2d5ed47b36602b3" have entirely different histories.
eb34ac65ae
...
22c58484cc
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue