use utf8;
use strict;
use warnings;
use open qw( :encoding(UTF-8) :std );
use Test::More tests => 15;
use Test::Differences;
use CLDR::Number;

my $cldr = CLDR::Number->new;

is $cldr->decimal_sign, ',', 'decimal directly from ar-DZ';

is $cldr->decimal_sign, '٫', 'decimal inherited from ar';

is $cldr->decimal_sign, ',', 'decimal directly from lu';
is $cldr->minus_sign,   '-', 'minus inherited from root';

is $cldr->decimal_sign, '.', 'decimal inherited from es-419, not es';
is $cldr->group_sign,   ',', 'group inherited from es-419, not es';

    # currency decimal is no longer used by any locale, so we manually add it here
    # to test the feature in case it’s reintroduced in the future
    local $CLDR::Number::Data::Base::DATA->{sv}{symbol}{currency_decimal} = ':';

    my $curf = $cldr->currency_formatter(locale => 'sv-FI');
    is $curf->decimal_sign, ':', 'currency decimal inherited from sv';

my $curf = $cldr->currency_formatter(locale => 'en-NZ');
is $curf->currency_sign, '$', 'currency sign directly from en-NZ';
is $curf->currency_sign, 'JP¥', 'currency sign inherited from en-001';

    [qw( sr-Cyrl-XK sr-Cyrl sr root )],
    'locale inheritance'

    [qw( root )],
    'root has a single level of inheritance'

    [qw( es-MX es-419 es root )],
    'locale inheritance with added step'

    [qw( az-Cyrl root )],
    'locale inheritance with removed step'

    [qw( zh-Hant-MO zh-Hant-HK zh-Hant root )],
    'locale inheritance with added and removed steps'

    [qw( en-US-u-va-posix en root )],
    'locale inheritance with Unicode extension'