2012-04-15 12:41:23 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
use utf8;
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
2016-05-16 06:07:57 -07:00
|
|
|
use Test::Deep;
|
2012-04-15 12:41:23 -07:00
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
2012-05-23 19:05:08 -07:00
|
|
|
zci answer_type => 'convert_to_ascii';
|
2012-04-15 12:41:23 -07:00
|
|
|
zci is_cached => 1;
|
|
|
|
|
2017-08-14 14:38:36 -07:00
|
|
|
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(
|
2017-08-14 14:38:36 -07:00
|
|
|
[qw(
|
|
|
|
DDG::Goodie::Unidecode
|
2012-04-15 12:41:23 -07:00
|
|
|
)],
|
2017-08-14 14:38:36 -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;
|