/
00-init.t
48 lines (41 loc) · 1.06 KB
/
00-init.t
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
40
41
42
43
44
45
46
47
48
#!perl
use strict;
use warnings;
use utf8;
use Test::More 0.94 tests => 3;
use Test::Builder 0.94 qw();
BEGIN {
use_ok('Lingua::Boolean', qw(boolean));
}
my @should_have_codes = (
'en',
'fr',
);
my @should_have_names = (
'English',
'Français',
);
subtest 'oo' => sub {
plan tests => 4;
my $bool = new_ok('Lingua::Boolean');
can_ok($bool, qw(boolean langs languages _looks_true _looks_false));
{ # Language codes
my @has = $bool->langs();
is_deeply(\@has, \@should_have_codes, 'Available language codes OK');
}
{ # Languages names
my @has = $bool->languages();
is_deeply(\@has, \@should_have_names, 'Available language names OK');
}
};
subtest 'func' => sub {
plan tests => 2;
{ # Language codes
my @has = Lingua::Boolean::langs();
is_deeply(\@has, \@should_have_codes, 'Available language codes OK');
}
{ # Language names
my @has = Lingua::Boolean::languages();
is_deeply(\@has, \@should_have_names, 'Available language names OK');
}
};