From 860594ffb7c013e5f4257bd615472e08c8c685c6 Mon Sep 17 00:00:00 2001 From: gabrielgio Date: Fri, 25 Mar 2022 22:43:47 +0100 Subject: ref: Add test for edge case Add test case for when you call with 0 length or no option (upper case, lower case, number and special). --- tests/web.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/web.rs b/tests/web.rs index 607f16d..b83608f 100644 --- a/tests/web.rs +++ b/tests/web.rs @@ -62,3 +62,15 @@ fn generate_not_special_letters() { } } } + +#[wasm_bindgen_test] +fn generate_0_len() { + let password = generate(0, true, true, true, true); + assert_eq!(0, password.len()) +} + +#[wasm_bindgen_test] +fn generate_no_letters() { + let password = generate(100, false, false, false, false); + assert_eq!(0, password.len()) +} -- cgit v1.2.3