From 6328ba84dba608209cece19dd08a1af76bd57fe8 Mon Sep 17 00:00:00 2001 From: Morten Linderud Date: Sun, 2 Dec 2018 16:02:15 +0100 Subject: Added docs, test and completion --- test/insert.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/insert.t') diff --git a/test/insert.t b/test/insert.t index a8c6458..938a6dd 100755 --- a/test/insert.t +++ b/test/insert.t @@ -139,4 +139,22 @@ test_expect_success 'Tolerates padding in secret' ' echo [[ $("$PASS" show Example/alice@google.com) == "$uri" ]] ' +test_expect_success 'Allow path prefixes in insert' ' + secret="JBSWY3DPEHPK3PXP==" + uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" + + test_pass_init && + "$PASS" otp insert -s -p totp -i Example -a alice@google.com <<< "$secret" && + echo [[ $("$PASS" show totp/Example/alice@google.com) == "$uri" ]] +' + +test_expect_success 'Allow multiple levels in path prefix' ' + secret="JBSWY3DPEHPK3PXP==" + uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" + + test_pass_init && + "$PASS" otp insert -s -p totp/pass-test -i Example -a alice@google.com <<< "$secret" && + echo [[ $("$PASS" show totp/pass-test/Example/alice@google.com) == "$uri" ]] +' + test_done -- cgit v1.2.3