1 # -*-Perl-*- Test Harness script for Bioperl
12 test_begin(-tests => 8);
14 use lib './examples/root/lib';
19 $Error::Debug = test_debug();
21 # Set up a tester object.
22 ok my $test = TestObject->new(-verbose => test_debug());
24 is $test->data('Eeny meeny miney moe.'), 'Eeny meeny miney moe.';
26 # This demonstrates what will happen if a method defined in an
27 # interface that is not implemented in the implementating object.
33 catch Bio::Root::NotImplemented with {
35 is ref $err, 'Bio::Root::NotImplemented';
39 # TestObject::bar() deliberately throws a Bio::TestException,
40 # which is defined in TestObject.pm
44 catch Bio::TestException with {
46 is ref $err, 'Bio::TestException';
50 # Use the non-object-oriented syntax to throw a generic Bio::Root::Exception.
52 throw Bio::Root::Exception( "A generic error", 42 );
54 catch Bio::Root::Exception with {
56 is ref $err, 'Bio::Root::Exception';
60 # Try to call a subroutine that doesn't exist. But because it occurs
61 # within a try block, the Error module will create a Error::Simple to
62 # capture it. Handy eh?
69 is ref $err, 'Error::Simple';