| 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 |
# declare some classes... |
| 11 |
{ |
| 12 |
package Woozle; |
| 13 |
our @ISA = ('Locale::Maketext'); |
| 14 |
sub dubbil { return $_[1] * 2 } |
| 15 |
sub numerate { return $_[2] . 'en' } |
| 16 |
} |
| 17 |
{ |
| 18 |
package Woozle::elx; |
| 19 |
our @ISA = ('Woozle'); |
| 20 |
our %Lexicon = ( |
| 21 |
'd2' => 'hum [dubbil,_1]', |
| 22 |
'd3' => 'hoo [quant,_1,zaz]', |
| 23 |
'd4' => 'hoo [*,_1,zaz]', |
| 24 |
); |
| 25 |
keys %Lexicon; # dodges the 'used only once' warning |
| 26 |
} |
| 27 |
|
| 28 |
my $lh = Woozle->get_handle('elx'); |
| 29 |
isa_ok( $lh, 'Woozle::elx' ); |
| 30 |
|
| 31 |
is( $lh->maketext('d2', 7), 'hum 14' ); |
| 32 |
is( $lh->maketext('d3', 7), 'hoo 7 zazen' ); |
| 33 |
is( $lh->maketext('d4', 7), 'hoo 7 zazen' ); |