use
vars
qw($NUMTESTS $DEBUG $error $msg)
;
BEGIN {
$DEBUG
=
$ENV
{
'BIOPERLDEBUG'
} || 0;
$error
= 0;
if
( $@ ) {
}
plan
tests
=> (
$NUMTESTS
= 5);
if
( $@ ) {
warn
(
"IO::String not installed. This means the Bio::DB::* modules are not usable. Skipping tests.\n"
)
if
$DEBUG
;
$msg
.=
'IO::String not installed. '
;
$error
= 1;
}
if
( $@ ) {
warn
(
"LWP::Simple not installed. This means the Bio::DB::* modules are not usable. Skipping tests.\n"
)
if
$DEBUG
;
$msg
.=
'LWP::Simple not installed. '
;
$error
= 1;
}
}
exit
(0)
if
$error
;
END {
foreach
(
$Test::ntest
..
$NUMTESTS
) {
skip(
$msg
,1);
}
}
my
$db
;
my
$verbose
=
$DEBUG
|| 0;
eval
{
ok (
$db
= new Bio::Biblio (
-access
=>
'eutils'
,
-verbose
=>
$verbose
));
ok(
defined
(
$db
->find(
'"Day A"[AU] AND ("Database Management Systems"[MH] OR "Databases, Genetic"[MH] OR "Software"[MH] OR "Software Design"[MH])'
)));
};
if
($@) {
warn
"Warning: Couldn't connect to Eutils server!\n$@\n"
if
$DEBUG
;
$msg
=
'No network access - could not connect to PubMed Eutils'
;
exit
(0);
}
while
(
my
$xml
=
$db
->get_next) {
ok(1);
}