From e6b1b62739606af0ddfddf64eb5129b18f3ac2af Mon Sep 17 00:00:00 2001 From: tossj Date: Mon, 18 Dec 2017 11:14:49 -0500 Subject: [PATCH] Conversions: Changed "=" to act like "to" in implicit conversions (#4553) --- lib/DDG/Goodie/Conversions.pm | 2 +- t/Conversions.t | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/DDG/Goodie/Conversions.pm b/lib/DDG/Goodie/Conversions.pm index 6a23afa61..b9d972df7 100755 --- a/lib/DDG/Goodie/Conversions.pm +++ b/lib/DDG/Goodie/Conversions.pm @@ -281,7 +281,7 @@ handle query => sub { || ( "" eq $left_num && "" eq $right_num && $question !~ qr/convert/i - && $connecting_word !~ qr/to/i )) + && $connecting_word !~ qr/to|=/i )) { $factor = $right_num; @matches = reverse @matches; diff --git a/t/Conversions.t b/t/Conversions.t index c663baa5c..b80f9a420 100755 --- a/t/Conversions.t +++ b/t/Conversions.t @@ -2194,6 +2194,14 @@ ddg_goodie_test( physical_quantity => 'volume' }) ), + 'oz = ml' => test_zci( + '', structured_answer => make_answer({ + raw_input => '1', + from_unit => 'impfluidounce', + to_unit => 'millilitre', + physical_quantity => 'volume' + }) + ), 'miles to nautical' => test_zci( '', structured_answer => make_answer({ raw_input => '1',