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;
|
2014-02-10 13:24:52 -08:00
|
|
|
|
use utf8;
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
|
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 => 'flip_text';
|
2014-10-07 04:13:19 -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 11:00:12 -07:00
|
|
|
|
sub build_structured_answer{
|
|
|
|
|
my ($input,$result) = @_;
|
|
|
|
|
return $result,
|
|
|
|
|
structured_answer => {
|
|
|
|
|
data => {
|
|
|
|
|
title => $result,
|
|
|
|
|
subtitle => "Flip text $input"
|
|
|
|
|
},
|
|
|
|
|
templates => {
|
|
|
|
|
group => 'text',
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sub build_test{ test_zci(build_structured_answer(@_)) }
|
|
|
|
|
|
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 04:13:19 -07:00
|
|
|
|
[qw( DDG::Goodie::FlipText)],
|
2016-05-14 11:00:12 -07:00
|
|
|
|
'flip text test' => build_test('test','ʇsǝʇ'),
|
|
|
|
|
'mirror text test' => build_test('test','ʇsǝʇ'),
|
|
|
|
|
'flip text my sentence' => build_test('my sentence','ǝɔuǝʇuǝs ʎɯ'),
|
|
|
|
|
'mirror text text' => build_test('text','ʇxǝʇ'),
|
|
|
|
|
'flip text <hello-world>' => build_test('<hello-world>','<pʃɹoʍ-oʃʃǝɥ>'),
|
|
|
|
|
'rotate text "hello world"' => build_test('"hello world"','„pʃɹoʍ oʃʃǝɥ„'),
|
|
|
|
|
'spin text ;hello world;' => build_test(';hello world;','؛pʃɹoʍ oʃʃǝɥ؛'),
|
|
|
|
|
'spin text [\'hello\']' => build_test('[\'hello\']','[,oʃʃǝɥ,]'),
|
|
|
|
|
'spin text <<"hello\' % & * () = + . #@!^(/world">>' => build_test('<<"hello\' % & * () = + . #@!^(/world">>','<<„pʃɹoʍ/)∨¡@# ˙ + = () ⁎ ⅋ % ,oʃʃǝɥ„>>'),
|
2016-06-27 14:57:33 -07:00
|
|
|
|
|
|
|
|
|
'photoshop flip text' => 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;
|