From 648f0f8fb427bea60500aaeca04bc7d965ec38da Mon Sep 17 00:00:00 2001 From: Aaron Feickert <66188213+AaronFeickert@users.noreply.github.com> Date: Tue, 17 Jan 2023 20:43:45 -0600 Subject: [PATCH] Tests --- .../tari_console_wallet/src/init/mod.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/applications/tari_console_wallet/src/init/mod.rs b/applications/tari_console_wallet/src/init/mod.rs index da6a0db5545..a550c1bf306 100644 --- a/applications/tari_console_wallet/src/init/mod.rs +++ b/applications/tari_console_wallet/src/init/mod.rs @@ -674,3 +674,22 @@ pub(crate) fn boot_with_password( Ok((boot_mode, password)) } + +#[cfg(test)] +mod test { + use tari_utilities::SafePassword; + + use super::get_password_feedback; + + #[test] + fn weak_password() { + let weak_password = SafePassword::from("weak"); + assert!(get_password_feedback(&weak_password).is_some()); + } + + #[test] + fn strong_password() { + let strong_password = SafePassword::from("This is a reasonably strong password!"); + assert!(get_password_feedback(&strong_password).is_none()); + } +}