2013-02-21 13:22:31 -08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
2014-08-09 18:56:47 -07:00
|
|
|
zci answer_type => 'calendar_conversion';
|
2014-09-20 14:10:28 -07:00
|
|
|
zci is_cached => 0;
|
2013-02-21 13:22:31 -08:00
|
|
|
|
2014-10-02 00:51:52 -07:00
|
|
|
my @g22h = (
|
|
|
|
'22 August 2003 (Gregorian) is 23 Jumaada Thani 1424 (Hijri)',
|
2014-10-06 01:39:48 -07:00
|
|
|
structured_answer => {
|
|
|
|
input => ['22 August 2003 (Gregorian)'],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Calendar conversion',
|
2014-10-06 01:39:48 -07:00
|
|
|
result => '23 Jumaada Thani 1424 (Hijri)'
|
|
|
|
},
|
2014-10-02 00:51:52 -07:00
|
|
|
);
|
|
|
|
my @h23g = (
|
|
|
|
'23 Jumaada Thani 1424 (Hijri) is 22 August 2003 (Gregorian)',
|
2014-10-06 01:39:48 -07:00
|
|
|
structured_answer => {
|
|
|
|
input => ['23 Jumaada Thani 1424 (Hijri)'],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Calendar conversion',
|
2014-10-06 01:39:48 -07:00
|
|
|
result => '22 August 2003 (Gregorian)'
|
|
|
|
},
|
2014-10-02 00:51:52 -07:00
|
|
|
);
|
|
|
|
my @g22j = (
|
|
|
|
'22 August 2003 (Gregorian) is 31 Mordad 1382 (Jalali)',
|
2014-10-06 01:39:48 -07:00
|
|
|
structured_answer => {
|
|
|
|
input => ['22 August 2003 (Gregorian)'],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Calendar conversion',
|
2014-10-06 01:39:48 -07:00
|
|
|
result => '31 Mordad 1382 (Jalali)'
|
|
|
|
},
|
2014-10-02 00:51:52 -07:00
|
|
|
);
|
|
|
|
|
2013-02-21 13:22:31 -08:00
|
|
|
ddg_goodie_test(
|
2014-08-09 18:19:16 -07:00
|
|
|
[qw(DDG::Goodie::CalendarConversion)],
|
2014-10-02 00:51:52 -07:00
|
|
|
'22/8/2003 to hijri' => test_zci(@g22h),
|
|
|
|
'22/8/2003 to the hijri calendar' => test_zci(@g22h),
|
|
|
|
'22,8,2003 to hijri' => test_zci(@g22h),
|
|
|
|
'23/6/1424 in hijri to gregorian years' => test_zci(@h23g),
|
|
|
|
'23/6/1424 hijri to gregorian' => test_zci(@h23g),
|
|
|
|
'22/8/2003 to jalali' => test_zci(@g22j),
|
|
|
|
'31/5/1382 jalali to gregorian' => test_zci(
|
|
|
|
'31 Mordad 1382 (Jalali) is 22 August 2003 (Gregorian)',
|
2014-10-06 01:39:48 -07:00
|
|
|
structured_answer => {
|
|
|
|
input => ['31 Mordad 1382 (Jalali)'],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Calendar conversion',
|
2014-10-06 01:39:48 -07:00
|
|
|
result => '22 August 2003 (Gregorian)'
|
|
|
|
},
|
2014-08-09 18:56:47 -07:00
|
|
|
),
|
|
|
|
'31/5/1382 jalali to hijri' => test_zci(
|
2014-10-02 00:51:52 -07:00
|
|
|
'31 Mordad 1382 (Jalali) is 23 Jumaada Thani 1424 (Hijri)',
|
2014-10-06 01:39:48 -07:00
|
|
|
structured_answer => {
|
|
|
|
input => ['31 Mordad 1382 (Jalali)'],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Calendar conversion',
|
2014-10-06 01:39:48 -07:00
|
|
|
result => '23 Jumaada Thani 1424 (Hijri)'
|
|
|
|
},
|
2014-08-09 18:56:47 -07:00
|
|
|
),
|
|
|
|
'23/6/1424 in hijri to jalali date' => test_zci(
|
2014-10-02 00:51:52 -07:00
|
|
|
'23 Jumaada Thani 1424 (Hijri) is 31 Mordad 1382 (Jalali)',
|
2014-10-06 01:39:48 -07:00
|
|
|
structured_answer => {
|
|
|
|
input => ['23 Jumaada Thani 1424 (Hijri)'],
|
2015-01-09 00:46:54 -08:00
|
|
|
operation => 'Calendar conversion',
|
2014-10-06 01:39:48 -07:00
|
|
|
result => '31 Mordad 1382 (Jalali)',
|
|
|
|
},
|
2014-10-01 23:51:52 -07:00
|
|
|
),
|
2014-10-02 00:51:52 -07:00
|
|
|
'August 22nd, 2003 to jalali' => test_zci(@g22j),
|
|
|
|
'22 Aug 2003 to Hijri' => test_zci(@g22h),
|
|
|
|
'22/8/2003 in the hijri calendar' => test_zci(@g22h),
|
|
|
|
'22nd Aug 2003 in jalali' => test_zci(@g22j),
|
|
|
|
'8-22-2003 in hijri years' => test_zci(@g22h),
|
|
|
|
'August 22 2003 in jalali date' => test_zci(@g22j),
|
2014-10-01 23:51:52 -07:00
|
|
|
'22nd Aug 2003 in gregorian time' => undef,
|
2013-02-21 13:22:31 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|