1193323Sed#!/usr/bin/perl -Tw
2193323Sed
3193323Seduse strict;
4193323Seduse Test::More tests => 6;
5193323Sed
6193323SedBEGIN {
7193323Sed    use_ok( 'Locale::Maketext' );
8193323Sed}
9193323Sed
10193323Seduse utf8;
11193323Sed
12193323Sed{
13193323Sed    package My::Localize;
14193323Sed    our @ISA = ('Locale::Maketext');
15193323Sed}
16193323Sed{
17193323Sed    package My::Localize::cs_cz;
18193323Sed    our @ISA = ('My::Localize');
19193323Sed    our %Lexicon = (
20193323Sed        '[_1]foo1\n' => '[_1]bar\n',
21193323Sed        '[_1]foo2\n' => '[_1]b��r\n',
22193323Sed        'foo2\n' => 'a��a\n',
23193323Sed        "[_1]foo\\n\n" => "[_1]bar\\n\n",
24193323Sed    );
25193323Sed    keys %Lexicon; # dodges the 'used only once' warning
26193323Sed}
27193323Sed
28193323Sedmy $lh = My::Localize->get_handle('cs_cz');
29212904Sdimisa_ok( $lh, 'My::Localize::cs_cz' );
30193323Sedis( $lh->maketext('[_1]foo1\n', 'arg'), 'argbar\n', 'Safe parameterized' );
31193323Sedis( $lh->maketext('[_1]foo2\n', 'arg'), 'argb��r\n', 'Unicode parameterized' );
32193323Sedis( $lh->maketext('foo2\n'), 'a��a\n', 'Unicode literal' );
33193323Sedis( $lh->maketext("[_1]foo\\n\n", 'arg'), "argbar\\n\n", 'new line parameterized' );
34193323Sed