Commit | Line | Data |
f666394a |
1 | #!/usr/bin/perl -Tw |
f600d105 |
2 | |
f666394a |
3 | use strict; |
4 | use Test::More tests => 3; |
f600d105 |
5 | |
f666394a |
6 | BEGIN { |
7 | use_ok( 'Locale::Maketext', 1.01 ); |
8 | } |
f600d105 |
9 | |
f600d105 |
10 | use utf8; |
11 | |
12 | # declare some classes... |
13 | { |
f666394a |
14 | package Woozle; |
15 | our @ISA = ('Locale::Maketext'); |
16 | sub dubbil { return $_[1] * 2 . chr(2000) } |
17 | sub numerate { return $_[2] . 'en' } |
f600d105 |
18 | } |
19 | { |
f666394a |
20 | package Woozle::eu_mt; |
21 | our @ISA = ('Woozle'); |
22 | our %Lexicon = ( |
23 | 'd2' => chr(1000) . 'hum [dubbil,_1]', |
24 | 'd3' => chr(1000) . 'hoo [quant,_1,zaz]', |
25 | 'd4' => chr(1000) . 'hoo [*,_1,zaz]', |
26 | ); |
27 | keys %Lexicon; # dodges the 'used only once' warning |
f600d105 |
28 | } |
29 | |
f666394a |
30 | my $lh = Woozle->get_handle('eu-mt'); |
31 | isa_ok( $lh, 'Woozle::eu_mt' ); |
32 | is( $lh->maketext('d2', 7), chr(1000).'hum 14'.chr(2000) ); |
f600d105 |
33 | |