Sunrise: Handles "at date" queries (#4082)

* quickfix adding at queries

* Added tests
master
Nalin Bhardwaj 2017-04-14 18:35:18 +05:30 committed by Zaahir Moolla
parent 5ce2486225
commit f280d574f4
2 changed files with 29 additions and 1 deletions

View File

@ -34,7 +34,7 @@ handle remainder => sub {
(?<lat>$lat_lon_regex[NS])\s
(?<lon>$lat_lon_regex[EW])\s?
)?
(?:on|for)?\s?
(?:on|for|at)?\s?
(?<when>$datestring_regex)?
$/xi;

View File

@ -126,6 +126,34 @@ ddg_goodie_test(
}
}
),
'sunset 7th of march 2017' => test_zci("On 07 Mar 2017, sunrise in Phoenixville, Pennsylvania is at 6:24 AM; sunset at 6:00 PM",
structured_answer => {
data => ignore(),
templates => {
group => 'text',
item => 0,
options => {
title_content => 'DDH.sun_info.title',
content => 'DDH.sun_info.content'
}
}
}
),
'sunset at 7 March 2017' => test_zci("On 07 Mar 2017, sunrise in Phoenixville, Pennsylvania is at 6:24 AM; sunset at 6:00 PM",
structured_answer => {
data => ignore(),
templates => {
group => 'text',
item => 0,
options => {
title_content => 'DDH.sun_info.title',
content => 'DDH.sun_info.content'
}
}
}
),
'sunset for philly' => undef,
'sunrise on mars' => undef,
'sunset boulevard' => undef,