File: register-from-data.t

package info (click to toggle)
libdatetime-locale-perl 1%3A1.45-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,688 kB
  • sloc: perl: 295,819; sh: 23; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;

use Test2::V0;

use DateTime::Locale;

{
    my $base_locale = DateTime::Locale->load('en-US');
    my %data        = $base_locale->locale_data;
    $data{code} = 'en-US-CUSTOM';

    DateTime::Locale->register_from_data(%data);
    my $l = DateTime::Locale->load('en-US-CUSTOM');

    isa_ok( $l, 'DateTime::Locale::FromData' );
    ok( $l, 'was able to load en_US_CUSTOM' );
    is( $l->code, 'en-US-CUSTOM', 'code is set properly' );
}

done_testing();