2013-02-28 22:13:21 -08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
2013-03-01 08:14:55 -08:00
|
|
|
zci answer_type => 'anagram';
|
2014-10-04 01:45:40 -07:00
|
|
|
zci is_cached => 1;
|
2013-02-28 22:13:21 -08:00
|
|
|
|
|
|
|
ddg_goodie_test(
|
2013-03-01 08:14:55 -08:00
|
|
|
[qw(DDG::Goodie::Anagram)],
|
2014-09-26 12:21:38 -07:00
|
|
|
'Anagram filter' => test_zci(
|
|
|
|
'trifle',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['filter'],
|
|
|
|
operation => 'anagrams of',
|
|
|
|
result => 'trifle',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'anagrams events' => test_zci(
|
|
|
|
'Steven',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['events'],
|
|
|
|
operation => 'anagrams of',
|
|
|
|
result => 'Steven',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'anagram of algorithm' => test_zci(
|
|
|
|
'logarithm',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['algorithm'],
|
|
|
|
operation => 'anagrams of',
|
|
|
|
result => 'logarithm',
|
|
|
|
}
|
|
|
|
),
|
2014-10-04 01:45:40 -07:00
|
|
|
'anagrams of favorite' => test_zci(
|
2014-09-26 12:21:38 -07:00
|
|
|
'-ANY-',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['favorite'],
|
|
|
|
operation => 'scrambled letters of',
|
|
|
|
result => '-ANY-',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'anagrams of "Mixing it up"' => test_zci(
|
|
|
|
'-ANY-',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['Mixing it up'],
|
|
|
|
operation => 'scrambled letters of',
|
|
|
|
result => '-ANY-',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'anagram times' => test_zci(
|
|
|
|
'emits, items, mites, smite',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['times'],
|
|
|
|
operation => 'anagrams of',
|
|
|
|
result => 'emits, items, mites, smite',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'anagrams stop' => test_zci(
|
|
|
|
'Post, opts, post, pots, spot, tops',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['stop'],
|
|
|
|
operation => 'anagrams of',
|
|
|
|
result => 'Post, opts, post, pots, spot, tops',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'anagram of lost' => test_zci(
|
|
|
|
'lots, slot',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['lost'],
|
|
|
|
operation => 'anagrams of',
|
|
|
|
result => 'lots, slot',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'anagram of voldemort' => test_zci(
|
|
|
|
'Tom Riddle',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['voldemort'],
|
|
|
|
operation => 'anagrams of',
|
|
|
|
result => 'Tom Riddle',
|
|
|
|
}
|
2014-10-03 10:28:18 -07:00
|
|
|
),
|
2014-10-04 01:45:40 -07:00
|
|
|
# No result tests.
|
|
|
|
'anagram of' => undef,
|
2014-10-07 11:57:04 -07:00
|
|
|
'anagrams for' => undef,
|
2014-10-04 01:45:40 -07:00
|
|
|
'anagrams for ""' => undef,
|
|
|
|
'anagrams for "867-5309"' => undef,
|
2014-02-10 13:24:52 -08:00
|
|
|
);
|
2013-02-28 22:13:21 -08:00
|
|
|
|
|
|
|
done_testing;
|