diff --git a/lib/DDG/Goodie/Calculator.pm b/lib/DDG/Goodie/Calculator.pm index a239b0237..6e986d73f 100644 --- a/lib/DDG/Goodie/Calculator.pm +++ b/lib/DDG/Goodie/Calculator.pm @@ -19,7 +19,7 @@ attribution web => [ 'https://www.duckduckgo.com', 'DuckDuckGo' ], triggers query_nowhitespace => qr< ^ - ( what is | calculate | math )? !? + ( what is | calculate | solve | math )? !? [\( \) x X * % + / \^ \$ -]* @@ -42,7 +42,7 @@ handle query_nowhitespace => sub { my $results_no_html; my $query = $_; - $query =~ s/^(?:whatis|calculate|math)//; + $query =~ s/^(?:whatis|calculate|solve|math)//; if($query !~ /[xX]\s*[\*\%\+\-\/\^]/ && $query !~ /^-?[\d]{2,3}\.\d+,\s?-?[\d]{2,3}\.\d+$/) { my $tmp_result = ''; diff --git a/t/Calculator.t b/t/Calculator.t index c291782a5..a36e5baf4 100644 --- a/t/Calculator.t +++ b/t/Calculator.t @@ -15,7 +15,7 @@ ddg_goodie_test( heading => 'Calculator', html => qq(
2 - 2 = 0
) ), - '2+2' => test_zci( + 'solve 2+2' => test_zci( "2 + 2 = 4", heading => 'Calculator', html => qq(
2 + 2 = 4
)