2012-05-07 20:52:20 -07:00
|
|
|
#!/usr/bin/env perl
|
2014-11-21 07:42:08 -08:00
|
|
|
|
2012-05-07 20:52:20 -07:00
|
|
|
use utf8;
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
2014-11-21 07:42:08 -08:00
|
|
|
|
2012-05-07 20:52:20 -07:00
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
2014-11-21 07:42:08 -08:00
|
|
|
zci answer_type => "iso639";
|
2012-05-07 20:52:20 -07:00
|
|
|
zci is_cached => 1;
|
|
|
|
|
|
|
|
ddg_goodie_test(
|
2014-11-21 07:42:08 -08:00
|
|
|
["DDG::Goodie::ISO639"],
|
|
|
|
"iso639 ab" => test_zci(
|
|
|
|
qq(ISO 639: Abkhazian - ab),
|
|
|
|
structured_answer => {
|
|
|
|
input => ['Abkhazian'],
|
|
|
|
operation => 'ISO 639 Language code',
|
|
|
|
result => 'ab',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
"iso639 english" => test_zci(
|
|
|
|
qq(ISO 639: English - en),
|
|
|
|
structured_answer => {
|
|
|
|
input => ['English'],
|
|
|
|
operation => 'ISO 639 Language code',
|
|
|
|
result => 'en',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
"iso639 eng" => test_zci(
|
|
|
|
qq(ISO 639: English - en),
|
|
|
|
structured_answer => {
|
|
|
|
input => ['English'],
|
|
|
|
operation => 'ISO 639 Language code',
|
|
|
|
result => 'en',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
"iso-639 en" => test_zci(
|
|
|
|
qq(ISO 639: English - en),
|
|
|
|
structured_answer => {
|
|
|
|
input => ['English'],
|
|
|
|
operation => 'ISO 639 Language code',
|
|
|
|
result => 'en',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
"language code french" => test_zci(
|
|
|
|
qq(ISO 639: French - fr),
|
|
|
|
structured_answer => {
|
|
|
|
input => ['French'],
|
|
|
|
operation => 'ISO 639 Language code',
|
|
|
|
result => 'fr',
|
|
|
|
}
|
|
|
|
),
|
|
|
|
"iso639 xyz" => undef,
|
2012-05-07 20:52:20 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|