From 7c296491fafc48c5594c4e14afe72a9c9552f6cf Mon Sep 17 00:00:00 2001 From: Sayan Nandan Date: Tue, 22 Feb 2022 20:02:25 -0800 Subject: [PATCH] Add tests --- tests/basic.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/basic.rs diff --git a/tests/basic.rs b/tests/basic.rs new file mode 100644 index 0000000..dcbe727 --- /dev/null +++ b/tests/basic.rs @@ -0,0 +1,9 @@ +extern crate rcrypt; +use rcrypt::DEFAULT_COST; + +#[test] +fn hash_and_verify() { + let mypass = String::from("pass123"); + let hash: Vec = rcrypt::hash(&mypass, DEFAULT_COST).unwrap(); + assert!(rcrypt::verify(&mypass, &hash).unwrap()); +}