From dd7824f431c4cc8b52e01b5b84c7a178229755d2 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Mon, 20 Mar 2017 13:52:25 -0700 Subject: Add cmd_otp_append for appending OTP secrets to existing passfiles --- test/code.t | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/code.t') diff --git a/test/code.t b/test/code.t index 4faea03..02bd086 100755 --- a/test/code.t +++ b/test/code.t @@ -24,4 +24,28 @@ test_expect_success 'Generates HOTP code and increments counter' ' [[ $("$PASS" otp uri passfile) == "$inc" ]] ' +test_expect_success 'HOTP counter increments and preserves multiline contents' ' + uri="otpauth://hotp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&counter=10&issuer=Example" + inc="otpauth://hotp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&counter=11&issuer=Example" + + read -r -d "" existing <