2014-12-16 19:21:55 -08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
|
|
|
zci answer_type => "phone_alphabet";
|
2015-01-29 12:45:50 -08:00
|
|
|
zci is_cached => 1;
|
2014-12-16 19:21:55 -08:00
|
|
|
|
|
|
|
ddg_goodie_test(
|
|
|
|
[qw( DDG::Goodie::PhoneAlphabet )],
|
2015-01-29 12:34:12 -08:00
|
|
|
'1-800-LAWYR-UP to digits' => test_zci(
|
2015-01-29 12:45:50 -08:00
|
|
|
'Phone Number: 1-800-52997-87',
|
2015-01-29 12:34:12 -08:00
|
|
|
structured_answer => {
|
|
|
|
input => ['1-800-LAWYR-UP'],
|
|
|
|
operation => 'Phone Number',
|
2015-01-29 12:45:50 -08:00
|
|
|
result => '1-800-52997-87'
|
2015-01-29 12:34:12 -08:00
|
|
|
}
|
|
|
|
),
|
|
|
|
|
|
|
|
'1-800-fun-hack to phone number' => test_zci(
|
|
|
|
'Phone Number: 1-800-386-4225',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['1-800-fun-hack'],
|
|
|
|
operation => 'Phone Number',
|
|
|
|
result => '1-800-386-4225'
|
|
|
|
}
|
|
|
|
),
|
2015-02-07 12:06:26 -08:00
|
|
|
'1-800-fun-hack to numbers' => test_zci(
|
|
|
|
'Phone Number: 1-800-386-4225',
|
|
|
|
structured_answer => {
|
|
|
|
input => ['1-800-fun-hack'],
|
|
|
|
operation => 'Phone Number',
|
|
|
|
result => '1-800-386-4225'
|
|
|
|
}
|
|
|
|
),
|
|
|
|
|
2015-01-29 12:34:12 -08:00
|
|
|
|
|
|
|
'1958funhack to phone' => test_zci(
|
2015-01-29 12:45:50 -08:00
|
|
|
'Phone Number: 19583864225',
|
2015-01-29 12:34:12 -08:00
|
|
|
structured_answer => {
|
|
|
|
input => ['1958funhack'],
|
|
|
|
operation => 'Phone Number',
|
|
|
|
result => '19583864225'
|
|
|
|
}
|
|
|
|
),
|
|
|
|
|
|
|
|
'13TAXI to phone' => test_zci(
|
2015-01-29 12:45:50 -08:00
|
|
|
'Phone Number: 138294',
|
2015-01-29 12:34:12 -08:00
|
|
|
structured_answer => {
|
|
|
|
input => ['13TAXI'],
|
|
|
|
operation => 'Phone Number',
|
|
|
|
result => '138294'
|
|
|
|
}
|
|
|
|
),
|
|
|
|
|
2014-12-17 18:49:12 -08:00
|
|
|
'something fun to hack to phone' => undef,
|
|
|
|
'0x0123 to digits' => undef
|
2014-12-16 19:21:55 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|