2015-11-28 02:46:31 -08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
2016-05-16 06:07:57 -07:00
|
|
|
use Test::Deep;
|
2015-11-28 02:46:31 -08:00
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
|
|
|
zci answer_type => "scramble";
|
2015-11-30 09:17:04 -08:00
|
|
|
zci is_cached => 0;
|
2015-11-28 02:46:31 -08:00
|
|
|
|
2016-05-19 04:51:53 -07:00
|
|
|
sub build_test {
|
|
|
|
my ($text, $input) = @_;
|
|
|
|
return test_zci($text, structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => ignore(),
|
|
|
|
subtitle => "Scramble of: $input"
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-11-28 02:46:31 -08:00
|
|
|
ddg_goodie_test(
|
|
|
|
[qw( DDG::Goodie::Scramble )],
|
2016-05-19 04:51:53 -07:00
|
|
|
'scramble of filter' => build_test('Scramble of filter', 'filter'),
|
2015-11-29 07:29:14 -08:00
|
|
|
'scramble of' => undef,
|
2016-05-19 04:51:53 -07:00
|
|
|
'Scramble for' => undef,
|
2015-11-29 07:29:14 -08:00
|
|
|
'Scrambles for ""' => undef,
|
|
|
|
'Scrambles for "867-5309"' => undef,
|
2015-11-28 02:46:31 -08:00
|
|
|
);
|
|
|
|
|
2016-05-16 06:18:04 -07:00
|
|
|
done_testing;
|