RC4: Test cleanup

master
Rob 2016-05-23 13:00:46 +01:00
parent d34f0d1f22
commit 4b6722259f
1 changed files with 6 additions and 6 deletions

12
t/Rc4.t
View File

@ -10,11 +10,11 @@ zci answer_type => "rc4";
zci is_cached => 1;
sub build_test {
my ($text, $title, $subtitle) = @_;
return test_zci($text, structured_answer => {
my ($direction, $input, $key, $answer) = @_;
return test_zci("RC4 $direction: $input, with key: $key is $answer", structured_answer => {
data => {
title => $title,
subtitle => $subtitle
title => $answer,
subtitle => "RC4 $direction: $input, Key: $key"
},
templates => {
group => 'text'
@ -26,8 +26,8 @@ ddg_goodie_test(
[qw(
DDG::Goodie::Rc4
)],
'rc4 en mysecretkey hello' => build_test("RC4 Encrypt: hello, with key: mysecretkey is grYU1K8=", "grYU1K8=", "RC4 Encrypt: hello, Key: mysecretkey"),
'rc4 de duck yWrJniG/nNg=' => build_test("RC4 Decrypt: yWrJniG/nNg=, with key: duck is DdgRocks", "DdgRocks", "RC4 Decrypt: yWrJniG/nNg=, Key: duck"),
'rc4 en mysecretkey hello' => build_test("Encrypt", "hello", "mysecretkey", "grYU1K8="),
'rc4 de duck yWrJniG/nNg=' => build_test("Decrypt", "yWrJniG/nNg=", "duck", "DdgRocks"),
'rc4 ' => undef,
'rc4 enc missing' => undef,
'rc4 no operation' => undef