Locale-TextDomain-OO

 view release on metacpan or  search on metacpan

t/15_gettext_Nloc_.t  view on Meta::CPAN

#!perl -T

use strict;
use warnings;

use Test::More tests => 11;
use Test::NoWarnings;
use Test::Differences;

BEGIN {
    require_ok('Locale::TextDomain::OO');
}

my $loc = Locale::TextDomain::OO->new(
    plugins => [ qw( Expand::Gettext::Loc ) ],
);
is
    $loc->Nloc_('This is a text.'),
    'This is a text.',
    'Nloc_ scalar context';
eq_or_diff
    [
        $loc->Nloc_(
            'This is a text.',
        ),
    ],
    [ 
        'This is a text.',
    ],
    'Nloc_ list context';
eq_or_diff
    [
        $loc->Nloc_x(
            '{name} is programming {language}.',
            name     => 'Steffen',
            language => 'Perl',
        ),
    ],
    [
        '{name} is programming {language}.',
        name     => 'Steffen',
        language => 'Perl',
    ],
    'Nloc_x';
eq_or_diff
    [
        $loc->Nloc_n(
            'Singular',
            'Plural',
            1,
        ),
    ],
    [ qw( Singular Plural 1 ) ],
    'Nloc_n';
eq_or_diff
    [
        $loc->Nloc_nx(
            '{num} shelf',
            '{num} shelves',
            1,
            num => 1,
        ),
    ],
    [
        '{num} shelf',
        '{num} shelves',
        1,
        num => 1,



( run in 1.890 second using v1.01-cache-2.11-cpan-98e64b0badf )