Debian Codegraph @

pubmed/t/1-test.t

raw ◀ ▶
1 Debian patch touch this file
1 #!/usr/bin/perl
2
3 use lib 'lib';
4 use WWW::Search;
•5 use Test::More;
6
7 my $s = new WWW::Search('PubMed');
•8
9 unless ($ENV{NO_NETWORK}) {
10 plan tests => 4;
11 }
12 else {
13 plan skip_all => "no network";
14 }
15
16 isa_ok( $s, 'WWW::Search' );
17
18 $s->native_query('ACGT');
19
20 my $r = $s->next_result();
21 ok( $r->title, 'Got title. Assuming everything is ok ;)' );
22
23 my $pmid = $r->pmid;
24 like( $pmid, qr/^\d+$/, 'Got pmid' );
25
26 my $abst = $r->abstract;
27 ok( length($abst), 'Got abstract' );