diff options
Diffstat (limited to 'tests/otp.rs')
-rw-r--r-- | tests/otp.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/otp.rs b/tests/otp.rs index fcf0020..712f7a2 100644 --- a/tests/otp.rs +++ b/tests/otp.rs @@ -125,6 +125,11 @@ fn hotp_error(device: DeviceWrapper) { Err(CommandError::InvalidSlot), admin.write_hotp_slot(slot_data, 0) ); + let slot_data = OtpSlotData::new(1, "test", "foobar", OtpMode::SixDigits); + assert_eq!( + Err(CommandError::InvalidHexString), + admin.write_hotp_slot(slot_data, 0) + ); let code = admin.get_hotp_code(4); assert_eq!(CommandError::InvalidSlot, code.unwrap_err()); } @@ -266,6 +271,11 @@ fn totp_error(device: DeviceWrapper) { Err(CommandError::InvalidSlot), admin.write_totp_slot(slot_data, 0) ); + let slot_data = OtpSlotData::new(4, "test", "foobar", OtpMode::SixDigits); + assert_eq!( + Err(CommandError::InvalidHexString), + admin.write_totp_slot(slot_data, 0) + ); let code = admin.get_totp_code(20); assert_eq!(CommandError::InvalidSlot, code.unwrap_err()); } |