summaryrefslogtreecommitdiff
path: root/src/tests/otp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/otp.rs')
-rw-r--r--src/tests/otp.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/tests/otp.rs b/src/tests/otp.rs
index 837b075..8802d9e 100644
--- a/src/tests/otp.rs
+++ b/src/tests/otp.rs
@@ -33,15 +33,16 @@ fn set_invalid_slot_raw(model: nitrokey::Model) {
#[test_device]
fn set_invalid_slot(model: nitrokey::Model) {
- let res = Nitrocli::with_model(model).handle(&["otp", "set", "100", "name", "1234", "-f", "hex"]);
-
- assert_eq!(
- res.unwrap_lib_err(),
- (
- Some("Could not write OTP slot"),
- nitrokey::LibraryError::InvalidSlot
- )
+ let err = Nitrocli::with_model(model)
+ .handle(&["otp", "set", "100", "name", "1234", "-f", "hex"])
+ .unwrap_err()
+ .to_string();
+ let expected = format!(
+ "Could not write OTP slot: {}",
+ nitrokey::Error::LibraryError(nitrokey::LibraryError::InvalidSlot)
);
+
+ assert_eq!(err, expected);
}
#[test_device]