Skip to content

Commit 2b7c829

Browse files
committed
add the two test cases for the OTPResult struct
1 parent aeba542 commit 2b7c829

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/otp_result.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use xotp::otp_result::OTPResult;
2+
3+
#[test]
4+
fn test_padding_needed() {
5+
let result = OTPResult::new(6, 1234);
6+
assert_eq!("001234", result.as_string())
7+
}
8+
9+
#[test]
10+
fn test_padding_not_needed() {
11+
let result = OTPResult::new(6, 123456);
12+
assert_eq!("123456", result.as_string())
13+
}

0 commit comments

Comments
 (0)