Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #554 from DavidMascio/lower

Adding Lowercase.pm
  • Loading branch information...
commit f40727f2f0ce667bce858570cdc623a221abc791 2 parents 4830b44 + ad1bf86
@moollaza moollaza authored
Showing with 58 additions and 0 deletions.
  1. +24 −0 lib/DDG/Goodie/Lowercase.pm
  2. +34 −0 t/Lowercase.t
View
24 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', 'lc', 'strtolower', 'tolower';
+
+handle remainder => sub {
+ return lc $_ if $_;
+ return;
+};
+
+1;
View
34 t/Lowercase.t
@@ -0,0 +1,34 @@
+#!/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'),
+ 'lowercase GitHub' =>
+ test_zci('github'),
+ 'lower case GitHub' =>
+ test_zci('github'),
+ 'lc GitHub' =>
+ test_zci('github'),
+ 'strtolower GitHub' =>
+ test_zci('github'),
+ 'tolower GitHub' =>
+ test_zci('github'),
+);
+
+done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.