Crypt-SKey
view release on metacpan or search on metacpan
t/03-interactive.t view on Meta::CPAN
use Test;
BEGIN {
require "t/common.pl";
skip_test("We don't seem to have a terminal for interactive mode")
unless -t STDIN;
$Crypt::SKey::HASH = (have_module('Digest::MD4') ? 'MD4' :
have_module('Digest::MD5') ? 'MD5' :
skip_test("Neither of Digest::MD4, Digest::MD5 is installed"));
need_module('Term::ReadKey');
}
BEGIN { plan tests => 2 }
use strict;
use Crypt::SKey qw(key compute);
ok(1);
{
warn "\nTesting interactive mode: enter 'pwd' (without quotes) at the prompt:\n";
local @ARGV = (50, 'fo099804');
my $got = key;
my $expect = 'HESS SWIM RAYS DING MOAT FAWN';
ok($got, $expect, $got);
}
( run in 0.907 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )