File: locale-data-is-cloned.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 (25 lines) | stat: -rw-r--r-- 505 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
use strict;
use warnings;

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

use DateTime::Locale;
use Storable qw( dclone );

{
    my $cldr = DateTime::Locale->load('en');

    my %locale_data = $cldr->locale_data;
    my $orig_data   = dclone( \%locale_data );

    delete $locale_data{available_formats};

    is(
        { $cldr->locale_data },
        $orig_data,
        'modifying locale_data does not affect the data in the locale object'
    );
}

done_testing();