Blame t/91_backslash.t

Packit f92f8e
#!/usr/bin/perl -Tw
Packit f92f8e
Packit f92f8e
use strict;
Packit f92f8e
use Test::More tests => 6;
Packit f92f8e
Packit f92f8e
BEGIN {
Packit f92f8e
    use_ok( 'Locale::Maketext' );
Packit f92f8e
}
Packit f92f8e
Packit f92f8e
use utf8;
Packit f92f8e
Packit f92f8e
{
Packit f92f8e
    package My::Localize;
Packit f92f8e
    our @ISA = ('Locale::Maketext');
Packit f92f8e
}
Packit f92f8e
{
Packit f92f8e
    package My::Localize::cs_cz;
Packit f92f8e
    our @ISA = ('My::Localize');
Packit f92f8e
    our %Lexicon = (
Packit f92f8e
        '[_1]foo1\n' => '[_1]bar\n',
Packit f92f8e
        '[_1]foo2\n' => '[_1]běr\n',
Packit f92f8e
        'foo2\n' => 'aěa\n',
Packit f92f8e
        "[_1]foo\\n\n" => "[_1]bar\\n\n",
Packit f92f8e
    );
Packit f92f8e
    keys %Lexicon; # dodges the 'used only once' warning
Packit f92f8e
}
Packit f92f8e
Packit f92f8e
my $lh = My::Localize->get_handle('cs_cz');
Packit f92f8e
isa_ok( $lh, 'My::Localize::cs_cz' );
Packit f92f8e
is( $lh->maketext('[_1]foo1\n', 'arg'), 'argbar\n', 'Safe parameterized' );
Packit f92f8e
is( $lh->maketext('[_1]foo2\n', 'arg'), 'argběr\n', 'Unicode parameterized' );
Packit f92f8e
is( $lh->maketext('foo2\n'), 'aěa\n', 'Unicode literal' );
Packit f92f8e
is( $lh->maketext("[_1]foo\\n\n", 'arg'), "argbar\\n\n", 'new line parameterized' );