File: RangeI.t

package info (click to toggle)
bioperl 1.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 20,336 kB
  • ctags: 8,476
  • sloc: perl: 119,890; xml: 6,001; lisp: 121; makefile: 57
file content (40 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: RangeI.t,v 1.5 2001/09/19 16:43:10 heikki Exp $

# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.t'

use strict;
use vars qw(@funcs);
BEGIN {
    # to handle systems with no installed Test module
    # we include the t dir (where a copy of Test.pm is located)
    # as a fallback
    eval { require Test; };
    if( $@ ) {
	use lib 't';
    }
    use Test;
    @funcs = qw(start end length strand overlaps contains 
		equals intersection union overlap_extent);
    plan tests => 19;
}

use Bio::RangeI;

my $i = 1;
my $func;
while ($func = shift @funcs) {
    $i++;
  if(exists $Bio::RangeI::{$func}) {
    ok(1);
    next if $func eq 'union';
    eval {
      $Bio::RangeI::{$func}->();
    };
    ok( $@ );
  } else {
    ok(0);
  }
}