This repository has been archived by the owner on Oct 15, 2022. It is now read-only.
Adding Lowercase.pm #554
Merged
Merged
Adding Lowercase.pm #554
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
22d2d1a
Add Lowercase.pm
DavidMascio ed55505
Add Lowercase.t
DavidMascio bb5c369
Test answer_type and is_cached
DavidMascio 4a5f241
Added new triggers lc, strtolower, and tolower
DavidMascio ad1bf86
Added tests for the example queries
DavidMascio File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; | ||
|
||
handle remainder => sub { | ||
return lc $_ if $_; | ||
return; | ||
}; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'), | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add tests for the example queries? Thanks, |
||
|
||
done_testing; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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