File: format-datetime.t

package info (click to toggle)
libdatetime-format-strptime-perl 1.7900-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 6,812 kB
  • sloc: perl: 1,400; sh: 23; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 434 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;

use Test::More 0.96;
use Test::Fatal;

use DateTime::Format::Strptime;
use DateTime;

my $strptime = DateTime::Format::Strptime->new(
    pattern  => '%B %Y',
    locale   => 'pt',
    on_error => 'croak',
);

my $e = exception { $strptime->format_datetime('somestring') };
is(
    $e->type->name,
    'DateTime',
    'got expected type failure when passing a string to format_datetime'
);

done_testing();