2014-01-31 16:26:50 -08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
2014-09-27 06:42:57 -07:00
|
|
|
zci answer_type => 'xkcd_sandwich';
|
|
|
|
zci is_cached => 1;
|
2014-01-31 16:26:50 -08:00
|
|
|
|
2014-10-09 01:44:11 -07:00
|
|
|
my @yes = (
|
|
|
|
'Okay.',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['sudo make me a sandwich'],
|
|
|
|
operation => '<a href="https://duckduckgo.com/?q=xkcd%20149">xkcd 149</a>',
|
|
|
|
result => 'Okay.'
|
|
|
|
});
|
|
|
|
my @no = (
|
|
|
|
'What? Make it yourself.',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['make me a sandwich'],
|
|
|
|
operation => '<a href="https://duckduckgo.com/?q=xkcd%20149">xkcd 149</a>',
|
|
|
|
result => 'What? Make it yourself.'
|
|
|
|
});
|
|
|
|
|
2014-01-31 16:26:50 -08:00
|
|
|
ddg_goodie_test(
|
2014-10-09 01:44:11 -07:00
|
|
|
['DDG::Goodie::MakeMeASandwich'],
|
|
|
|
'make me a sandwich' => test_zci(@no),
|
|
|
|
'MAKE ME A SANDWICH' => test_zci(@no),
|
|
|
|
'sudo make me a sandwich' => test_zci(@yes),
|
|
|
|
'SUDO MAKE ME A SANDWICH' => test_zci(@yes),
|
2014-02-02 08:52:42 -08:00
|
|
|
'blahblah make me a sandwich' => undef,
|
2014-10-09 01:44:11 -07:00
|
|
|
'0 make me a sandwich' => undef,
|
2014-01-31 16:26:50 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|