2013-06-21 13:35:10 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
2013-06-21 14:04:04 -07:00
|
|
|
use DDG::Test::Location;
|
|
|
|
use DDG::Request;
|
2013-06-21 13:35:10 -07:00
|
|
|
|
|
|
|
zci answer_type => 'helpline';
|
|
|
|
|
2013-06-21 14:04:04 -07:00
|
|
|
my @queries = (
|
|
|
|
'suicide'
|
|
|
|
);
|
|
|
|
|
|
|
|
my @locations = (
|
|
|
|
'us',
|
|
|
|
);
|
|
|
|
|
2013-06-21 13:35:10 -07:00
|
|
|
ddg_goodie_test(
|
|
|
|
[qw(
|
|
|
|
DDG::Goodie::HelpLine
|
|
|
|
)],
|
2013-06-21 14:19:06 -07:00
|
|
|
map {(
|
|
|
|
DDG::Request->new(
|
|
|
|
query_raw => "$queries[$_]",
|
2013-06-21 14:20:03 -07:00
|
|
|
location => test_location("$locations[$_]")
|
2013-06-21 14:19:06 -07:00
|
|
|
),
|
|
|
|
test_zci(qr/24 Hour Suicide Hotline: [\d\-){7}]/),
|
|
|
|
)} 0 .. scalar @queries - 1
|
2013-06-21 13:35:10 -07:00
|
|
|
);
|
|
|
|
|
2013-06-21 14:19:06 -07:00
|
|
|
done_testing(scalar @queries * scalar @locations * 2);
|