This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
From: Todd Rinaldo <toddr@cpanel.net>
[perl5.git] / dist / Locale-Maketext / t / 70_fail_auto.t
CommitLineData
213a5d2c
FC
1#!/usr/bin/perl -Tw
2
3use strict;
4use Test::More tests => 5;
5
6BEGIN {
7 use_ok( 'Locale::Maketext' );
8}
9
10{
11 package Whunk::L10N;
12 use vars qw(@ISA);
13 @ISA = 'Locale::Maketext';
14}
15
16{
17 package Whunk::L10N::en;
18 use vars qw(@ISA);
19 @ISA = 'Whunk::L10N';
20}
21
22my $lh = Whunk::L10N->get_handle('en');
23$lh->fail_with('failure_handler_auto');
24
25is($lh->maketext('abcd'), 'abcd', "simple missing keys are handled");
26is($lh->maketext('abcd'), 'abcd', "even in repeated calls");
27# CPAN RT #25877 - $value Not Set After Second Call to failure_handler_auto()
28
29is($lh->maketext('Hey, [_1]', 'you'), 'Hey, you', "keys with bracket notation ok");
30
31is($lh->maketext('_key'), '_key', "keys which start with _ ok");
32