Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
2016-05-16 06:07:57 -07:00
|
|
|
use Test::Deep;
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
|
|
|
zci answer_type => 'title_case';
|
2014-10-07 00:49:21 -07:00
|
|
|
zci is_cached => 1;
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
|
2016-05-14 14:44:23 -07:00
|
|
|
sub build_test
|
|
|
|
{
|
|
|
|
my ($text, $input) = @_;
|
|
|
|
|
|
|
|
return test_zci($text, structured_answer => {
|
|
|
|
data => {
|
|
|
|
title => $text,
|
|
|
|
subtitle => 'Title case: '.$input
|
|
|
|
},
|
|
|
|
templates => {
|
|
|
|
group => 'text'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
ddg_goodie_test(
|
2014-10-07 00:49:21 -07:00
|
|
|
[qw( DDG::Goodie::TitleCase)],
|
2016-05-14 14:44:23 -07:00
|
|
|
'titlecase test this out' => build_test('Test This Out', 'test this out'),
|
|
|
|
'titlecase this is a walk in the park' => build_test('This Is a Walk in the Park', 'this is a walk in the park'),
|
|
|
|
'titlecase a good day to die hard' => build_test('A Good Day to Die Hard', 'a good day to die hard'),
|
|
|
|
'titlecase A GOOD DAY TO DIE HARD' => build_test('A Good Day to Die Hard', 'A GOOD DAY TO DIE HARD'),
|
|
|
|
'titlecase here i am testing-hyphenated-words' => build_test('Here I Am Testing-Hyphenated-Words', 'here i am testing-hyphenated-words'),
|
|
|
|
'titlecase test' => build_test('Test', 'test'),
|
2014-10-07 00:49:21 -07:00
|
|
|
'how do i make something titlecase' => undef,
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
);
|
|
|
|
|
2016-05-16 06:18:04 -07:00
|
|
|
done_testing;
|