1#!/usr/bin/perl -Tw
2
3use strict;
4use Test::More tests => 5;
5
6BEGIN {
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
28my $lh = Woozle->get_handle('elx');
29isa_ok( $lh, 'Woozle::elx' );
30
31is( $lh->maketext('d2', 7), 'hum 14' );
32is( $lh->maketext('d3', 7), 'hoo 7 zazen' );
33is( $lh->maketext('d4', 7), 'hoo 7 zazen' );
34