File: 09version-check.t

package info (click to toggle)
libdatetime-locale-perl 1%3A1.02-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 13,540 kB
  • sloc: perl: 1,718; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 615 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
use strict;
use warnings;

use Test::More;
use Test::Warnings qw( warnings );

{

    package DateTime::Locale::fake;

    use strict;
    use warnings;

    use DateTime::Locale;

    use base 'DateTime::Locale::Base';

    sub cldr_version {0}

    DateTime::Locale->register(
        id          => 'fake',
        en_language => 'Fake',
    );
}

my @warnings = warnings { DateTime::Locale->load('fake') };
is( scalar @warnings, 1, 'got one warning from loading old locale' );
like(
    $warnings[0],
    qr/\Qfrom an older version (0)/,
    'loading locale from an older CLDR version warns'
);

done_testing()