File: 16-state.t

package info (click to toggle)
libdatetime-format-natural-perl 1.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 616 kB
  • sloc: perl: 9,587; makefile: 2
file content (16 lines) | stat: -rwxr-xr-x 439 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl

use strict;
use warnings;

use DateTime::Format::Natural;
use Test::More tests => 1;

{
    # Expected to fail with first parse ('31/09/2009'), because
    # parse_datetime_duration() retains the first failing state.
    my $string = '31/09/2009 to 31/10/2009';
    my $parser = DateTime::Format::Natural->new;
    $parser->parse_datetime_duration($string);
    ok(!$parser->success && defined $parser->error, $string);
}