zeroclickinfo-goodies/t/Rc4.t

33 lines
754 B
Perl
Raw Normal View History

2015-02-23 10:19:45 -08:00
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Deep;
2015-02-23 10:19:45 -08:00
use DDG::Test::Goodie;
zci answer_type => "rc4";
zci is_cached => 1;
ddg_goodie_test(
[qw(
DDG::Goodie::Rc4
)],
2015-03-04 13:12:06 -08:00
'rc4 en mysecretkey hello' => test_zci("RC4 Encrypt: hello, with key: mysecretkey is grYU1K8=",
2015-02-23 10:19:45 -08:00
structured_answer => {
input => ['hello, Key: mysecretkey'],
2015-03-04 13:12:06 -08:00
operation => "RC4 Encrypt",
2015-02-23 10:19:45 -08:00
result => "grYU1K8="
}),
2015-03-04 13:12:06 -08:00
'rc4 de duck yWrJniG/nNg=' => test_zci("RC4 Decrypt: yWrJniG/nNg=, with key: duck is DdgRocks",
2015-02-23 10:19:45 -08:00
structured_answer => {
input => ['yWrJniG/nNg=, Key: duck'],
2015-03-04 13:12:06 -08:00
operation => "RC4 Decrypt",
2015-02-23 10:19:45 -08:00
result => "DdgRocks"
}),
'rc4 ' => undef,
'rc4 enc missing' => undef,
'rc4 no operation' => undef
);
done_testing;