1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
use Test::More;
use utf8;
use strict;
use warnings;
require_ok 'Pass::OTP';
require_ok 'Pass::OTP::URI';
is(
Pass::OTP::otp(
secret => "00",
),
'328482',
'oathtool 00',
);
is(
Pass::OTP::otp(
secret => "00",
counter => 100,
),
'032003',
'oathtool -c 100 00',
);
is(
Pass::OTP::otp(
Pass::OTP::URI::parse('otpauth://hotp/Test?secret=abcdefgh')
),
'058591',
'otptool otpauth://hotp/Test?secret=abcdefgh',
);
is(
Pass::OTP::otp(
Pass::OTP::URI::parse('otpauth://totp/Test?secret=abcdefgh&issuer=Steam&now=1')
),
'KMP7M',
'otptool otpauth://totp/Test?secret=abcdefgh&issuer=Steam',
);
done_testing(6);
|