~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/Genomewise.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*-Perl-*-
2
 
## Bioperl Test Harness Script for Modules
3
 
 
4
 
 
5
 
use strict;
6
 
BEGIN {
7
 
    eval { require Test; };
8
 
    if( $@ ) {
9
 
        use lib 't';
10
 
    }
11
 
    use Test;
12
 
    use vars qw($NTESTS);
13
 
    $NTESTS = 20;
14
 
    plan tests => $NTESTS;
15
 
}
16
 
use Bio::Tools::Genomewise;
17
 
 
18
 
END {
19
 
        for ( $Test::ntest..$NTESTS ) {
20
 
                skip("Cannot complete genomewise tests, skipping.",1);
21
 
        }
22
 
}
23
 
 
24
 
 
25
 
my $inputfilename= Bio::Root::IO->catfile("t","data","genomewise.out");
26
 
my $parser = Bio::Tools::Genomewise->new(-file => $inputfilename);
27
 
my @gene;
28
 
while (my $gene= $parser->next_prediction){
29
 
    push @gene, $gene;
30
 
}
31
 
my @t = $gene[0]->transcripts;
32
 
my @e = $t[0]->exons;
33
 
 
34
 
ok ($t[0]->source_tag, 'genomewise');
35
 
ok ($e[0]->source_tag, 'genomewise');
36
 
ok ($t[0]->primary_tag, 'transcript');
37
 
ok ($e[0]->primary_tag, 'exon');
38
 
 
39
 
ok (scalar($t[0]->exons), 5);
40
 
ok ($t[0]->start, 4761);
41
 
ok ($t[0]->end, 6713);
42
 
ok ($e[0]->start,4761);
43
 
ok ($e[0]->end, 4874);
44
 
my ($phase) = $e[0]->each_tag_value('phase');
45
 
ok ($phase,0);
46
 
 
47
 
open(FH,$inputfilename);
48
 
$parser = Bio::Tools::Genomewise->new(-fh=>\*FH);
49
 
while (my $gene= $parser->next_prediction){
50
 
    push @gene, $gene;
51
 
}
52
 
@t = $gene[1]->transcripts;
53
 
@e = $t[0]->exons;
54
 
 
55
 
ok ($t[0]->source_tag, 'genomewise');
56
 
ok ($e[0]->source_tag, 'genomewise');
57
 
ok ($t[0]->primary_tag, 'transcript');
58
 
ok ($e[0]->primary_tag, 'exon');
59
 
 
60
 
ok (scalar($t[0]->exons), 3);
61
 
ok ($t[0]->start, 9862);
62
 
ok ($t[0]->end, 10316);
63
 
ok ($e[1]->start,10024);
64
 
ok ($e[1]->end, 10211);
65
 
 
66
 
($phase) = $e[2]->each_tag_value('phase');
67
 
ok ($phase,2);
68
 
 
69
 
 
70
 
 
71
 
 
72
 
 
73
 
 
74
 
 
75
 
 
76
 
 
77