Skip to content

Commit 9e7602c

Browse files
committed
Fix password strength test expectation
Corrected test_password_strength_strong to expect score of 4 instead of 5. The PasswordStrength::check() function explicitly caps the maximum score at 4 as documented in the implementation (line 120, 179). This resolves the failing CI test.
1 parent 2aaf98f commit 9e7602c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

examples/file_encryption.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ Transaction History:
3636
" Encrypted size: {} bytes",
3737
encrypted_data.ciphertext.len()
3838
);
39-
println!(
40-
" Nonce (12 bytes): {}",
41-
hex::encode(encrypted_data.nonce)
42-
);
39+
println!(" Nonce (12 bytes): {}", hex::encode(encrypted_data.nonce));
4340
println!(
4441
" First 32 bytes of ciphertext: {}...",
4542
hex::encode(&encrypted_data.ciphertext[..32.min(encrypted_data.ciphertext.len())])

src/keyderivation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ mod tests {
265265
#[test]
266266
fn test_password_strength_strong() {
267267
let (score, feedback) = PasswordStrength::check("MyStr0ng!P@ssw0rd2024");
268-
assert_eq!(score, 5);
268+
assert_eq!(score, 4); // Maximum score is 4 per implementation
269269
assert!(feedback.is_empty());
270270
}
271271

0 commit comments

Comments
 (0)