Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Adding Lowercase.pm #554

Merged
merged 5 commits into from Jul 19, 2014
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions lib/DDG/Goodie/Lowercase.pm
@@ -0,0 +1,24 @@
package DDG::Goodie::Lowercase;
use DDG::Goodie;

# ABSTRACT: Convert a string into lowercase.
name "Lowercase";
description "Convert a string into lowercase.";
primary_example_queries "lowercase GitHub";
secondary_example_queries "lower case GitHub";
category 'conversions';
topics 'programming';
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Lowercase.pm';
attribution github => ["DavidMascio"];

zci is_cached => 1;
zci answer_type => "lowercase";

triggers start => 'lowercase', 'lower case';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about adding lc strtolower tolower


handle remainder => sub {
return lc $_ if $_;
return;
};

1;
24 changes: 24 additions & 0 deletions t/Lowercase.t
@@ -0,0 +1,24 @@
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;
use DDG::Test::Goodie;

zci answer_type => 'lowercase';
zci is_cached => 1;

ddg_goodie_test(
[
'DDG::Goodie::Lowercase'
],
'lowercase foo' =>
test_zci('foo'),
'lower case foO' =>
test_zci('foo'),
'lowercase john Doe' =>
test_zci('john doe'),
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests for the example queries?

Thanks,


done_testing;