File: format-length.t

package info (click to toggle)
libdatetime-locale-perl 1%3A1.31-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 18,840 kB
  • sloc: perl: 214,424; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 973 bytes parent folder | download
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
37
38
use strict;
use warnings;

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

use DateTime::Locale;

my $loc = DateTime::Locale->load('root');

is(
    $loc->default_date_format_length, 'medium',
    'default date format length is medium'
);
is(
    $loc->default_time_format_length, 'medium',
    'default time format length is medium'
);

is( $loc->date_format_default, 'y MMM d',  'check default date format' );
is( $loc->time_format_default, 'HH:mm:ss', 'check default time format' );

$loc->set_default_date_format_length('short');
$loc->set_default_time_format_length('short');

is(
    $loc->default_date_format_length, 'short',
    'default date format length is short'
);
is(
    $loc->default_time_format_length, 'short',
    'default time format length is short'
);

is( $loc->date_format_default, 'y MMM d',  'check default date format' );
is( $loc->time_format_default, 'HH:mm:ss', 'check default time format' );

done_testing();