mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-24 17:11:49 +00:00
fix: improve test_random_8_char_string
This commit is contained in:
parent
1d871fbcc1
commit
9cffa8db9f
1 changed files with 8 additions and 6 deletions
|
|
@ -254,12 +254,14 @@ pub async fn decrypt_file_with_private_key_as_buffer<P: AsRef<Path>>(
|
||||||
mod tests {
|
mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_random_8_char_string() {
|
fn test_random_8_char_string() {
|
||||||
let s = super::random_8_char_string();
|
for _ in 0..1000 {
|
||||||
// Is 8 chars long
|
let s = super::random_8_char_string();
|
||||||
assert_eq!(s.len(), 8);
|
// Is 8 chars long
|
||||||
// Does not contain possibly confusing characters
|
assert_eq!(s.len(), 8);
|
||||||
assert!(!s.contains('0'));
|
// Does not contain possibly confusing characters
|
||||||
assert!(!s.contains('O'));
|
assert!(!s.contains('0'));
|
||||||
|
assert!(!s.contains('O'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue