Skip to content

Commit

Permalink
expand un trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
yegg committed May 9, 2012
1 parent e2aad5a commit 73dd755
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/DDG/Goodie/UN.pm
Expand Up @@ -12,6 +12,8 @@ zci answer_type => 'united_nations';

handle remainder => sub {
my $num = shift or return;
$num =~ s/^number\s+//gi;

my %un = get_un($num) or return;
$un{description} =~ s/\.$//;
return (sprintf qq(UN Number %04d - %s.), $num, $un{description}), html => sprintf qq(<a href="%s">UN Number %04d</a> - %s.), wphref($num), $num, $un{description};
Expand Down
1 change: 1 addition & 0 deletions t/UN.t
Expand Up @@ -14,6 +14,7 @@ ddg_goodie_test(
DDG::Goodie::UN
)],
'un 9' => test_zci('UN Number 0009 - Ammunition, incendiary with or without burster, expelling charge, or propelling charge.', html => '<a href="http://en.wikipedia.org/wiki/List_of_UN_numbers_0001_to_0100">UN Number 0009</a> - Ammunition, incendiary with or without burster, expelling charge, or propelling charge.', answer_type => "united_nations"),
'un number 9' => test_zci('UN Number 0009 - Ammunition, incendiary with or without burster, expelling charge, or propelling charge.', html => '<a href="http://en.wikipedia.org/wiki/List_of_UN_numbers_0001_to_0100">UN Number 0009</a> - Ammunition, incendiary with or without burster, expelling charge, or propelling charge.', answer_type => "united_nations"),
'un 1993' => test_zci('UN Number 1993 - Combustible liquids, n.o.s.', html => '<a href="http://en.wikipedia.org/wiki/List_of_UN_numbers_1901_to_2000">UN Number 1993</a> - Combustible liquids, n.o.s.', answer_type => "united_nations"),

);
Expand Down

0 comments on commit 73dd755

Please sign in to comment.