2012-09-19 21:01:41 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
use Convert::Braille;
|
2013-03-31 21:43:58 -07:00
|
|
|
use utf8;
|
2012-09-19 21:01:41 -07:00
|
|
|
|
|
|
|
zci answer_type => 'braille';
|
2014-10-06 11:00:41 -07:00
|
|
|
zci is_cached => 1;
|
2012-09-19 21:01:41 -07:00
|
|
|
|
|
|
|
ddg_goodie_test(
|
2014-10-06 11:00:41 -07:00
|
|
|
[qw( DDG::Goodie::Braille)],
|
|
|
|
'hello in braille' => test_zci(
|
|
|
|
"⠓⠑⠇⠇⠕ (Braille)",
|
|
|
|
structured_answer => {
|
|
|
|
input => ['hello'],
|
|
|
|
operation => 'Braille translation',
|
|
|
|
result => '⠓⠑⠇⠇⠕'
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'⠓⠑⠇⠇⠕' => test_zci(
|
|
|
|
"hello (Braille)",
|
|
|
|
structured_answer => {
|
|
|
|
input => ['⠓⠑⠇⠇⠕'],
|
|
|
|
operation => 'Braille translation',
|
|
|
|
result => 'hello'
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'translate to braille translate to braille' => test_zci(
|
|
|
|
"⠞⠗⠁⠝⠎⠇⠁⠞⠑⠀⠞⠕⠀⠃⠗⠁⠊⠇⠇⠑ (Braille)",
|
|
|
|
structured_answer => {
|
|
|
|
input => ['translate to braille'],
|
|
|
|
operation => 'Braille translation',
|
|
|
|
result =>
|
|
|
|
'⠞⠗⠁⠝⠎⠇⠁⠞⠑⠀⠞⠕⠀⠃⠗⠁⠊⠇⠇⠑'
|
|
|
|
}
|
|
|
|
),
|
|
|
|
'⠞⠗⠁⠝⠎⠇⠁⠞⠑⠀⠞⠕⠀⠃⠗⠁⠊⠇⠇⠑' => test_zci(
|
|
|
|
"translate to braille (Braille)",
|
|
|
|
structured_answer => {
|
|
|
|
input => [
|
|
|
|
'⠞⠗⠁⠝⠎⠇⠁⠞⠑⠀⠞⠕⠀⠃⠗⠁⠊⠇⠇⠑'
|
|
|
|
],
|
|
|
|
operation => 'Braille translation',
|
|
|
|
result => 'translate to braille'
|
|
|
|
}
|
|
|
|
|
|
|
|
),
|
|
|
|
'braille asdf k' => test_zci(
|
|
|
|
"⠁⠎⠙⠋⠀⠅ (Braille)",
|
|
|
|
structured_answer => {
|
|
|
|
input => ['asdf k'],
|
|
|
|
operation => 'Braille translation',
|
|
|
|
result => '⠁⠎⠙⠋⠀⠅'
|
|
|
|
}
|
|
|
|
|
|
|
|
),
|
|
|
|
'⠁⠎⠙⠋⠀⠅' => test_zci(
|
|
|
|
"asdf k (Braille)",
|
|
|
|
structured_answer => {
|
|
|
|
input => ['⠁⠎⠙⠋⠀⠅'],
|
|
|
|
operation => 'Braille translation',
|
|
|
|
result => 'asdf k'
|
|
|
|
}
|
|
|
|
|
|
|
|
),
|
2012-09-19 21:01:41 -07:00
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|