Commit | Line | Data |
f666394a |
1 | #!/usr/bin/perl -Tw |
2 | |
3 | use strict; |
5350a4e5 |
4 | |
5350a4e5 |
5 | use Test; |
6 | BEGIN { plan tests => 4; } |
7 | use Locale::Maketext; |
8 | print "# Hi there...\n"; |
9 | ok 1; |
10 | |
11 | print "# --- Making sure that Perl globals are localized ---\n"; |
12 | |
13 | # declare a class... |
14 | { |
15 | package Woozle; |
f666394a |
16 | our @ISA = ('Locale::Maketext'); |
17 | our %Lexicon = ( |
5350a4e5 |
18 | _AUTO => 1 |
19 | ); |
20 | keys %Lexicon; # dodges the 'used only once' warning |
21 | } |
22 | |
23 | my $lh; |
24 | print "# Basic sanity:\n"; |
25 | ok defined( $lh = Woozle->new() ) && ref($lh); |
26 | |
27 | print "# Make sure \$@ is localized...\n"; |
28 | $@ = 'foo'; |
f666394a |
29 | ok $lh && $lh->maketext('Eval error: [_1]', $@), 'Eval error: foo'; |
5350a4e5 |
30 | |
31 | print "# Byebye!\n"; |
32 | ok 1; |