diff options
Diffstat (limited to 'test/validate.t')
-rwxr-xr-x | test/validate.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/validate.t b/test/validate.t index 6d05fdf..13c6049 100755 --- a/test/validate.t +++ b/test/validate.t @@ -5,7 +5,8 @@ export test_description='Tests pass otp URI parsing' . ./setup.sh test_expect_success 'Parses a basic TOTP URI' ' - "$PASS" otp validate "otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" + "$PASS" otp validate "otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" + echo $otp_type ' test_expect_success 'Parses a complex TOTP URI' ' @@ -28,4 +29,16 @@ test_expect_success 'Fails for missing counter' ' test_must_fail "$PASS" otp validate otpauth://hotp?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ ' +test_expect_success 'Parses TOTP URI with port number' ' + "$PASS" otp validate "otpauth://totp/Example:alice@google.com:443?secret=JBSWY3DPEHPK3PXP&issuer=Example" +' + +test_expect_success 'Parses a complex TOTP URI with port number' ' + "$PASS" otp validate otpauth://totp/ACME%20Co:john.doe@email.com:443?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30 +' + +test_expect_success 'Parses a HOTP URI with port umber' ' + "$PASS" otp validate "otpauth://hotp/Example:alice@google.com:443?secret=JBSWY3DPEHPK3PXP&counter=10&issuer=Example" +' + test_done |