html_entities: Added new triggers & tests (#4203)

* added new triggers

* added new test
master
Robert Badea 2017-05-22 21:40:24 +03:00 committed by Zaahir Moolla
parent 9ca979f198
commit a588c17f81
3 changed files with 18 additions and 4 deletions

View File

@ -10,13 +10,15 @@ use YAML::XS 'LoadFile';
zci answer_type => 'html_entities';
zci is_cached => 1;
triggers startend => 'html entities';
triggers startend => share('triggers.txt')->slurp;
my $table = LoadFile(share('entities.yml'));
handle query_lc => sub {
handle remainder => sub {
return unless m/^(list of )?html entities( table| list)?$/;
s/\b(list of|table|list)\b//g;
return if $_;
return 'HTML Entities', structured_answer => {
data => {

View File

@ -0,0 +1,7 @@
html characters
html chars
html named characters
html escape sequences
html entities
html named entities
html entities codes

View File

@ -43,7 +43,12 @@ ddg_goodie_test(
[qw( DDG::Goodie::HtmlEntities )],
'html entities' => build_test(),
'html entities table' => build_test(),
'html entities list' => build_test()
'html entities list' => build_test(),
'html named entities' => build_test(),
'list of html entities' => build_test(),
'html' => undef,
'html entity' => undef,
'html alphanumeric characters' => undef
);
done_testing;