zeroclickinfo-goodies/t/FlipText.t

45 lines
1.4 KiB
Perl
Raw Permalink Normal View History

#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Test::More;
use Test::Deep;
use DDG::Test::Goodie;
zci answer_type => 'flip_text';
2014-10-07 04:13:19 -07:00
zci is_cached => 1;
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(@_)) }
ddg_goodie_test(
2014-10-07 04:13:19 -07:00
[qw( DDG::Goodie::FlipText)],
'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ʃʃǝɥ„>>'),
'photoshop flip text' => undef
);
2016-05-16 06:18:04 -07:00
done_testing;