1# Before `make install' is performed this script should be runnable with
2# `make test'. After `make install' it should work as `perl test.pl'
3
4#########################
5
6# change 'tests => 1' to 'tests => last_test_to_print';
7
8use Test::More tests => 21;
9use Lingua::EN::Inflect::Number (qw( PL_N to_PL to_S number));
10
11ok(*PL_N{CODE}, "Imported something from L::EN::Inflect");
12ok(*to_PL{CODE}, "Imported something from Number");
13
14is(number("goat"), "s", "one goat");
15is(number("goats"), "p", "two goats");
16is(number("sheep"), "ambig", "who knows how many sheep?");
17
18test_all(@$_) for (
19     [ qw(  goat goats )],
20     [ qw( brewery breweries )],
21     [ qw( beer beers )],
22     [ qw( sheep sheep )],
23 );
24
25sub test_all {
26    my ($s, $p) = @_;
27    is( to_S($p), $s, "$p to singular is $s");
28    is( to_S($s), $s, "$s is already singular");
29    is( to_PL($s), $p, "Force $s to plural");
30    is( to_PL($p), $p, "Force $p to plural");
31}
32
33#########################
34
35# Insert your test code below, the Test module is use()ed here so read
36# its man page ( perldoc Test ) for help writing this test script.
37
38