2
## Bioperl Test Harness Script for Modules
3
## $Id: RootI.t,v 1.8 2006/07/12 18:46:22 sac Exp $
5
# Before `make install' is performed this script should be runnable with
6
# `make test'. After `make install' it should work as `perl test.t'
11
# to handle systems with no installed Test module
12
# we include the t dir (where a copy of Test.pm is located)
14
eval { require Test; };
25
my $obj = new Bio::Root::Root();
26
ok defined($obj) && $obj->isa('Bio::Root::RootI');
28
eval { $obj->throw('Testing throw') };
29
ok $@ =~ /Testing throw/;# 'throw failed';
31
# doesn't work in perl 5.00405
34
# my ($tfh,$tfile) = $obj->tempfile();
35
# local * STDERR = $tfh;
36
# $obj->warn('Testing warn');
38
# open(IN, $tfile) or die("cannot open $tfile");
39
# $val = join("", <IN>) ;
43
#ok $val =~ /Testing warn/;
44
#'verbose(0) warn did not work properly' . $val;
47
eval { $obj->throw('Testing throw') };
48
ok $@=~ /Testing throw/;# 'verbose(-1) throw did not work properly' . $@;
50
eval { $obj->warn('Testing warn') };
54
eval { $obj->throw('Testing throw') };
55
ok $@ =~ /Testing throw/;# 'verbose(1) throw did not work properly' . $@;
57
# doesn't work in perl 5.00405
60
# my ($tfh,$tfile) = $obj->tempfile();
61
# local * STDERR = $tfh;
62
# $obj->warn('Testing warn');
64
# open(IN, $tfile) or die("cannot open $tfile");
65
# $val = join("", <IN>);
69
#ok $val =~ /Testing warn/;# 'verbose(1) warn did not work properly' . $val;
71
my @stack = $obj->stack_trace();
74
my $verbobj = new Bio::Root::Root(-verbose=>1,-strict=>1);
75
ok $verbobj->verbose(), 1;
77
$Bio::Root::Root::DEBUG = 1;
79
my $seq = new Bio::Seq;
83
my @vals = Bio::Root::RootI->_rearrange([qw(apples pears)],
86
eval { $obj->throw_not_implemented() };
87
ok $@ =~ /Bio::Root::NotImplemented/;
89
ok(shift @vals, 'up the');
90
ok(shift @vals, 'stairs');