Permalink
Browse files

30DaysOfTests: check that hard password generation is hard

  • Loading branch information...
conradkdotcom committed Aug 24, 2017
1 parent e853535 commit 6beec144a414407f93309cb090ec855f47bad09b
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/generate.rs
View
@@ -127,5 +127,17 @@ mod test {
_ => panic!()
}
}
// At least one not alnum
let ps = PasswordSpec::new(false, None);
let pw = ps.generate_hard_password().unwrap();
let mut ok = false;
for c in pw.deref().chars() {
match c {
'a'...'z' | 'A'...'Z' | '0'...'9' => {},
_ => { ok = true }
}
}
assert!(ok);
}
}

0 comments on commit 6beec14

Please sign in to comment.