zeroclickinfo-goodies/t/Unidecode.t

34 lines
635 B
Perl
Raw Normal View History

2012-04-15 12:41:23 -07:00
#!/usr/bin/env perl
use utf8;
use strict;
use warnings;
use Test::More;
use Test::Deep;
2012-04-15 12:41:23 -07:00
use DDG::Test::Goodie;
zci answer_type => 'convert_to_ascii';
2012-04-15 12:41:23 -07:00
zci is_cached => 1;
sub build_test {
my ($decoded) = @_;
return test_zci($decoded, structured_answer => {
data => {
title => $decoded
},
templates => {
group => 'text'
}
});
}
2012-04-15 12:41:23 -07:00
ddg_goodie_test(
[qw(
DDG::Goodie::Unidecode
2012-04-15 12:41:23 -07:00
)],
"unidecode møæp" => build_test('moaep'),
"unidecode \x{5317}\x{4EB0}" => build_test('Bei Jing'),
"unidecode å亰" => build_test('aaodeg'),
2012-04-15 12:41:23 -07:00
);
done_testing;