File: script.t

package info (click to toggle)
libdatetime-locale-perl 1%3A1.41-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 26,068 kB
  • sloc: perl: 286,446; sh: 23; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 766 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
24
25
26
27
28
29
30
31
32
33
34
35
36
use strict;
use warnings;
use utf8;

use Test2::V0;
use Test::File::ShareDir::Dist { 'DateTime-Locale' => 'share' };

use DateTime::Locale;

my %tests = (
    'bs-Latn' => {
        name        => 'Bosnian Latin',
        script      => 'Latin',
        script_code => 'Latn',
    },
    'zh-Hans-SG' => {
        script         => 'Simplified',
        native_script  => '简体',
        script_code    => 'Hans',
        territory_code => 'SG',
    },
);

for my $code ( sort keys %tests ) {
    subtest(
        $code,
        sub {
            my $loc = DateTime::Locale->load($code);
            for my $meth ( sort keys %{ $tests{$code} } ) {
                is( $loc->$meth, $tests{$code}{$meth}, "$meth" );
            }
        }
    );
}

done_testing();