@@ -131,6 +131,21 @@ fn deterministic_generation_uses_only_requested_characters_and_length() -> TestR
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn in_process_generation_returns_a_zeroizing_unstored_secret() -> TestResult {
|
||||
let config = GeneratorConfig::new(12, "abc123")?;
|
||||
let generated = config.generate_secret(NonZeroUsize::new(48), false)?;
|
||||
assert_eq!(generated.expose().len(), 48);
|
||||
assert!(
|
||||
generated
|
||||
.expose()
|
||||
.iter()
|
||||
.all(|byte| b"abc123".contains(byte))
|
||||
);
|
||||
assert!(!format!("{generated:?}").contains(std::str::from_utf8(generated.expose())?));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn default_no_symbols_and_presentation_actions_are_typed() -> TestResult {
|
||||
let fixture = FixtureSet::load()?;
|
||||
|
||||
Reference in New Issue
Block a user