File: L10N.t

package info (click to toggle)
libweather-com-perl 0.5.0-3etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 344 kB
  • ctags: 148
  • sloc: perl: 3,509; makefile: 46; sh: 11
file content (39 lines) | stat: -rw-r--r-- 1,203 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#####################################################################
#
#  Test suite for 'Weather::Com::L10N'
#
#  Before `make install' is performed this script should be runnable
#  with `make test'. After `make install' it should work as
#  `perl t/L10N.t'
#
#####################################################################
#
# initialization
#
no warnings;
use Test::More tests => 7;

BEGIN {
	use_ok('Weather::Com::L10N');
}

#####################################################################
#
# Testing object instantiation (do we use the right class)?
#
my $wind = Weather::Com::L10N->get_handle('de');
isa_ok( $wind, "Weather::Com::L10N",   'Is a Weatcher::Com::L10N object' );
isa_ok( $wind, "Locale::Maketext", 'Is a Locale::Maketext object' );

# test for existing translations
is($wind->maketext('unknown'), 'unbekannt', 'Translation of known words');
is($wind->maketext('NNE'), 'NNO', 'Translation of known words');

# test for non-existent translations
is($wind->maketext('hello'), 'hello', 'Translation of unknown words');

# test for non-existent languages
$wind = Weather::Com::L10N->get_handle('kr');
is($wind->maketext('unknown'), 'unknown', 'Test for default language');