aboutsummaryrefslogtreecommitdiff
path: root/src/tests/otp.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2020-08-31 19:25:48 -0700
committerDaniel Mueller <deso@posteo.net>2020-08-31 19:25:48 -0700
commit67ba96eb7d592ac7c09b2221420c6f706ac89a13 (patch)
treef2b10da5027e724d0f2286036290f331a08fd123 /src/tests/otp.rs
parent419ff8531c163200a5e7d21d4d0f7ac7ff8d25f8 (diff)
downloadnitrocli-67ba96eb7d592ac7c09b2221420c6f706ac89a13.tar.gz
nitrocli-67ba96eb7d592ac7c09b2221420c6f706ac89a13.tar.bz2
Remove application global Result definition
In the past we were using an application global custom Result type definition. This makes less sense now that we switched over to using anyhow's Error and Result types. We kept that for the time being, but with this change we remove the type and use anyhow::Result instead.
Diffstat (limited to 'src/tests/otp.rs')
-rw-r--r--src/tests/otp.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tests/otp.rs b/src/tests/otp.rs
index 65c1cb5..f94df2d 100644
--- a/src/tests/otp.rs
+++ b/src/tests/otp.rs
@@ -42,7 +42,7 @@ fn set_invalid_slot(model: nitrokey::Model) {
}
#[test_device]
-fn status(model: nitrokey::Model) -> crate::Result<()> {
+fn status(model: nitrokey::Model) -> anyhow::Result<()> {
let re = regex::Regex::new(
r#"^alg\tslot\tname
((totp|hotp)\t\d+\t.+\n)+$"#,
@@ -60,7 +60,7 @@ fn status(model: nitrokey::Model) -> crate::Result<()> {
}
#[test_device]
-fn set_get_hotp(model: nitrokey::Model) -> crate::Result<()> {
+fn set_get_hotp(model: nitrokey::Model) -> anyhow::Result<()> {
// Secret and expected HOTP values as per RFC 4226: Appendix D -- HOTP
// Algorithm: Test Values.
const SECRET: &str = "12345678901234567890";
@@ -81,7 +81,7 @@ fn set_get_hotp(model: nitrokey::Model) -> crate::Result<()> {
}
#[test_device]
-fn set_get_totp(model: nitrokey::Model) -> crate::Result<()> {
+fn set_get_totp(model: nitrokey::Model) -> anyhow::Result<()> {
// Secret and expected TOTP values as per RFC 6238: Appendix B --
// Test Vectors.
const SECRET: &str = "12345678901234567890";
@@ -97,7 +97,7 @@ fn set_get_totp(model: nitrokey::Model) -> crate::Result<()> {
}
#[test_device]
-fn set_totp_uneven_chars(model: nitrokey::Model) -> crate::Result<()> {
+fn set_totp_uneven_chars(model: nitrokey::Model) -> anyhow::Result<()> {
let secrets = [
(args::OtpSecretFormat::Hex, "123"),
(args::OtpSecretFormat::Base32, "FBILDWWGA2"),
@@ -111,7 +111,7 @@ fn set_totp_uneven_chars(model: nitrokey::Model) -> crate::Result<()> {
}
#[test_device]
-fn clear(model: nitrokey::Model) -> crate::Result<()> {
+fn clear(model: nitrokey::Model) -> anyhow::Result<()> {
let mut ncli = Nitrocli::with_model(model);
let _ = ncli.handle(&["otp", "set", "3", "hotp-test", "abcdef"])?;
let _ = ncli.handle(&["otp", "clear", "3"])?;