aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2022-03-25 22:43:47 +0100
committergabrielgio <gabriel.giovanini@pm.me>2022-03-25 22:43:47 +0100
commit860594ffb7c013e5f4257bd615472e08c8c685c6 (patch)
treea5a46af59046ca1c3a18a1c5a7d93c91024c22b3 /tests
parentb92dd0a4c59287b661759d3cdcd6f62e1afcd815 (diff)
downloadgenpass-860594ffb7c013e5f4257bd615472e08c8c685c6.tar.gz
genpass-860594ffb7c013e5f4257bd615472e08c8c685c6.tar.bz2
genpass-860594ffb7c013e5f4257bd615472e08c8c685c6.zip
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).
Diffstat (limited to 'tests')
-rw-r--r--tests/web.rs12
1 files changed, 12 insertions, 0 deletions
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())
+}