ensure we handle upper case queries properly

master
Zaahir Moolla 2016-12-21 14:48:49 -05:00
parent 6f0b4d9ac7
commit dbb9214312
2 changed files with 3 additions and 2 deletions

View File

@ -48,12 +48,12 @@ my @triggers = map { ("$_", "$_?") } keys %queries;
triggers start => @triggers;
handle remainder => sub {
handle remainder_lc => sub {
# ensure no remainder, query == trigger
return if $_;
my $query = $req->matched_trigger;
my $query = lc $req->matched_trigger;
$query =~ s/\?//;
my $answer = $queries{$query}{answer};
my $link = $queries{$query}{link};

View File

@ -42,6 +42,7 @@ ddg_goodie_test(
[qw( DDG::Goodie::HistoricalEvents )],
'is the moon landing real' => build_test('the Moon landing is real', $moon_landing_url),
'is the Moon Landing real' => build_test('the Moon landing is real', $moon_landing_url),
'was the moon landing real?' => build_test('the Moon landing was real', $moon_landing_url),
'did the moon landing happen' => build_test('the Moon landing happened', $moon_landing_url),
'did the moon landing really happen' => build_test('the Moon landing happened', $moon_landing_url),