| 1 |
#!/usr/bin/perl -Tw |
| 2 |
|
| 3 |
use strict; |
| 4 |
use Test::More tests => 5; |
| 5 |
|
| 6 |
BEGIN { |
| 7 |
use_ok( 'Locale::Maketext' ); |
| 8 |
} |
| 9 |
|
| 10 |
{ |
| 11 |
package Whunk::L10N; |
| 12 |
our @ISA = 'Locale::Maketext'; |
| 13 |
} |
| 14 |
|
| 15 |
{ |
| 16 |
package Whunk::L10N::en; |
| 17 |
our @ISA = 'Whunk::L10N'; |
| 18 |
} |
| 19 |
|
| 20 |
my $lh = Whunk::L10N->get_handle('en'); |
| 21 |
$lh->fail_with('failure_handler_auto'); |
| 22 |
|
| 23 |
is($lh->maketext('abcd'), 'abcd', "simple missing keys are handled"); |
| 24 |
is($lh->maketext('abcd'), 'abcd', "even in repeated calls"); |
| 25 |
# CPAN RT #25877 - $value Not Set After Second Call to failure_handler_auto() |
| 26 |
|
| 27 |
is($lh->maketext('Hey, [_1]', 'you'), 'Hey, you', "keys with bracket notation ok"); |
| 28 |
|
| 29 |
is($lh->maketext('_key'), '_key', "keys which start with _ ok"); |
| 30 |
|