2
2
## Bioperl Test Harness Script for Modules
3
## $Id: Variation_IO.t,v 1.13 2001/12/14 17:52:44 jason Exp $
3
## $Id: Variation_IO.t,v 1.20 2005/09/17 02:11:21 bosborne Exp $
6
use vars qw($NUMTESTS);
8
eval { require Test; };
14
eval { require 'Text/Wrap.pm' };
15
if( $@ || $Text::Wrap::VERSION < 98 ) {
16
print STDERR "Must have at least Text::Wrap 98 installed\n";
8
use vars qw($NUMTESTS $error);
10
eval { require Test; };
20
if ( $@ || $Text::Wrap::VERSION < 98 ) {
21
print STDERR "Skip tests - missing Text::Wrap 98 installed or XML::Writer\n";
25
plan tests => $NUMTESTS;
29
foreach ( $Test::ntest..$NUMTESTS) {
30
skip("Cannot complete Variation_IO tests",1);
22
plan tests => $NUMTESTS;
26
38
use Bio::Variation::IO;
29
41
sub fileformat ($) {
32
if ($file =~ /.*dat$/) {
35
elsif ($file =~ /.*xml$/ ) {
38
print "Wrong extension! [$file]";
44
if ($file =~ /.*dat$/) {
47
elsif ($file =~ /.*xml$/ ) {
50
print "Wrong extension! [$file]";
46
my ($name) = $file =~ /.*.(...)$/;
58
my ($name) = $file =~ /.*.(...)$/;
52
my ($name) = $file =~ /(.*)....$/;
64
my ($name) = $file =~ /(.*)....$/;
104
116
ok $after;# "Error in reading in again the output file [$o_file]";
106
117
ok $before, $after, "test output file differs from input";
107
118
print STDERR `diff $t_file $o_file` if $before ne $after;
114
122
io (Bio::Root::IO->catfile("t","data","mutations.dat"),
115
Bio::Root::IO->catfile("t","data","mutations.out.dat")); #1..5
123
Bio::Root::IO->catfile("t","data","mutations.out.dat")); #1..5
117
124
io (Bio::Root::IO->catfile("t","data","polymorphism.dat"),
118
Bio::Root::IO->catfile("t","data","polymorphism.out.dat")); #6..10
125
Bio::Root::IO->catfile("t","data","polymorphism.out.dat")); #6..10
122
128
require Bio::Variation::IO::xml;
137
io (Bio::Root::IO->catfile("t","data","mutations.xml"),
138
Bio::Root::IO->catfile("t","data","mutations.out.xml")); #10..12
143
if( $XML::Writer::VERSION >= 0.5 ) {
144
io (Bio::Root::IO->catfile("t","data","mutations.xml"),
145
Bio::Root::IO->catfile("t","data","mutations.out.xml")); #10..12
147
io (Bio::Root::IO->catfile("t","data","mutations.old.xml"),
148
Bio::Root::IO->catfile("t","data","mutations.out.xml")); #10..12
142
io (Bio::Root::IO->catfile("t","data","polymorphism.xml"),
143
Bio::Root::IO->catfile("t","data","polymorphism.out.xml")); #13..14
153
if( $XML::Writer::VERSION >= 0.5 ) {
154
io (Bio::Root::IO->catfile("t","data","polymorphism.xml"),
155
Bio::Root::IO->catfile("t","data","polymorphism.out.xml")); #13..14
157
io (Bio::Root::IO->catfile("t","data","polymorphism.old.xml"),
158
Bio::Root::IO->catfile("t","data","polymorphism.out.xml")); #13..14
148
io (Bio::Root::IO->catfile("t","data","mutations.dat"),
149
Bio::Root::IO->catfile("t","data","mutations.out.xml")); #15..25
164
if( $XML::Writer::VERSION >= 0.5 ) {
165
io (Bio::Root::IO->catfile("t","data","mutations.dat"),
166
Bio::Root::IO->catfile("t","data","mutations.out.xml")); #15..25
168
io (Bio::Root::IO->catfile("t","data","mutations.old.dat"),
169
Bio::Root::IO->catfile("t","data","mutations.old.out.xml")); #15..25