Code cleanup

This commit is contained in:
2024-02-22 12:44:02 +03:00
parent 8979cc5b25
commit b526eb0c12
18 changed files with 124 additions and 148 deletions

View File

@ -140,9 +140,9 @@ mod tests {
#[test]
fn account_encryption() -> crate::Result<()> {
let original = Decrypted {
name: "Account Name".into(),
login: "StrongLogin@mail.com".into(),
password: "StrongP@$$word!".into(),
name: "Account Name".to_owned(),
login: "StrongLogin@mail.com".to_owned(),
password: "StrongP@$$word!".to_owned(),
};
let account = original.clone().into_account(1, TESTING_MASTER_PASSWORD);
let decrypted = Decrypted::from_account(account, TESTING_MASTER_PASSWORD)?;

View File

@ -73,3 +73,21 @@ impl From<MasterPass> for HashedBytes<Vec<u8>, Vec<u8>> {
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn params_valid() {
#[allow(clippy::no_effect_underscore_binding)]
let _params: &Params = &PARAMS; // Initializes the PARAMS, which might panic if the passed in values are invalid
}
#[test]
fn hashing_test() {
const ORIGINAL: &[u8] = b"Important data";
assert!(HashedBytes::new(ORIGINAL).verify(ORIGINAL));
}
}