File: basic.t

package info (click to toggle)
libdatetime-format-builder-perl 0.8300-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 504 kB
  • sloc: perl: 1,236; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 513 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
use strict;
use warnings;

use Test::More 0.88;

use DateTime::Format::Builder;

# Does new() work properly?
{
    eval { DateTime::Format::Builder->new('fnar') };
    ok( ( $@ and $@ =~ /takes no param/ ), "Too many parameters exception" );

    my $obj = eval { DateTime::Format::Builder->new() };
    ok( !$@, "Created object" );
    isa_ok( $obj, 'DateTime::Format::Builder' );

    eval { $obj->parse_datetime("whenever") };
    ok( ( $@ and $@ =~ /No parser/ ), "No parser exception" );

}

done_testing();