Commit | Line | Data |
f600d105 |
1 | |
2 | require 5; |
3 | use Test; |
4 | BEGIN { plan tests => 4; } |
5 | use Locale::Maketext 1.01; |
6 | print "# Hi there...\n"; |
7 | ok 1; |
8 | |
9 | |
10 | print "# --- Making sure that get_handle works with utf8 ---\n"; |
11 | use utf8; |
12 | |
13 | # declare some classes... |
14 | { |
15 | package Woozle; |
16 | @ISA = ('Locale::Maketext'); |
17 | sub dubbil { return $_[1] * 2 .chr(2000)} |
18 | sub numerate { return $_[2] . 'en' } |
19 | } |
20 | { |
21 | package Woozle::eu_mt; |
22 | @ISA = ('Woozle'); |
23 | %Lexicon = ( |
24 | 'd2' => chr(1000) . 'hum [dubbil,_1]', |
25 | 'd3' => chr(1000) . 'hoo [quant,_1,zaz]', |
26 | 'd4' => chr(1000) . 'hoo [*,_1,zaz]', |
27 | ); |
28 | keys %Lexicon; # dodges the 'used only once' warning |
29 | } |
30 | |
31 | my $lh; |
32 | print "# Basic sanity:\n"; |
33 | ok defined( $lh = Woozle->get_handle('eu-mt') ) && ref($lh); |
34 | ok $lh && $lh->maketext('d2', 7), chr(1000)."hum 14".chr(2000) ; |
35 | |
36 | |
37 | print "# Byebye!\n"; |
38 | ok 1; |
39 | |