DatesRole: Adding explicit test for matching the descriptive_datestring_regex

master
Rob Emery 2014-10-12 22:04:52 +01:00 committed by Matt Miller
parent ae3688378e
commit 1ce8e865c1
1 changed files with 1 additions and 0 deletions

View File

@ -332,6 +332,7 @@ subtest 'Dates' => sub {
set_fixed_time($query_time);
my %strings = %{$time_strings{$query_time}};
foreach my $test_date (sort keys %strings) {
like($test_date, qr/^$test_descriptive_datestring_regex$/, "$test_date matches the descriptive_datestring_regex");
my $result = DatesRoleTester::parse_descriptive_datestring_to_date($test_date);
isa_ok($result, 'DateTime', $test_date);
is(DatesRoleTester::date_output_string($result), $strings{$test_date}, $test_date . ' relative to ' . $query_time);