Imported Upstream version 0.2.0
[tabix.git] / perl / t / 02remote.t
1 #-*-Perl-*-
2 use Test::More tests => 9;
3 BEGIN { use_ok('Tabix') };
4
5 { # FTP access
6         my $t = Tabix->new(-data=>"ftp://ftp.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_03/pilot1/CEU.SRP000031.2010_03.genotypes.vcf.gz");
7         ok($t);
8         my $iter = $t->query("1", 1000000, 1100000);
9         ok($iter);
10         $_ = 0;
11         ++$_ while ($t->read($iter));
12         is($_, 306);
13         @_ = $t->getnames;
14         is(scalar(@_), 22);
15 }
16
17 { # FTP access plus FTP index
18         my $t = Tabix->new(-data=>"ftp://ftp.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_03/pilot1/CEU.SRP000031.2010_03.genotypes.vcf.gz",
19                                            -index=>"ftp://ftp.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_03/pilot1/CEU.SRP000031.2010_03.genotypes.vcf.gz.tbi");
20         ok($t);
21         my $iter = $t->query("19", 10000000, 10100000);
22         ok($iter);
23         $_ = 0;
24         ++$_ while ($t->read($iter));
25         is($_, 268);
26         @_ = $t->getnames;
27         is(scalar(@_), 22);
28 }