[Bioperl-guts-l] bioperl-live/t Range.t,1.10,1.11

Senduran Balasubramaniam sendu at dev.open-bio.org
Mon Jun 26 10:46:48 EDT 2006


Update of /home/repository/bioperl/bioperl-live/t
In directory dev.open-bio.org:/tmp/cvs-serv4746/t

Modified Files:
	Range.t 
Log Message:
intersection now can take an array ref: slight API change

Index: Range.t
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/t/Range.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Range.t	3 May 2006 16:10:38 -0000	1.10
--- Range.t	26 Jun 2006 14:46:45 -0000	1.11
***************
*** 16,20 ****
  	}
  	use Test;
! 	plan tests => 35;
  }
  
--- 16,20 ----
  	}
  	use Test;
! 	plan tests => 40;
  }
  
***************
*** 27,31 ****
  									 -strand=>1);
  ok(defined $range);
! ok( $range->strand, 1);
  
  my $range2 = Bio::Range->new(-start=>15,
--- 27,31 ----
  									 -strand=>1);
  ok(defined $range);
! ok($range->strand, 1);
  
  my $range2 = Bio::Range->new(-start=>15,
***************
*** 52,55 ****
--- 52,68 ----
  ok($r->strand, 1);
  
+ # intersection and union can also take lists
+ my $range3 = Bio::Range->new(-start=>18,-end=>30);
+ $r = $range->intersection([$range2, $range3]);
+ ok($r->start == 18 && $r->end == 20);
+ $r = Bio::Range->intersection([$range, $range2, $range3]);
+ ok($r->start == 18 && $r->end == 20);
+ $r = $range->union($range2, $range3);
+ ok($r->start == 10 && $r->end == 30);
+ $r = Bio::Range->union($range, $range2, $range3);
+ ok($r->start == 10 && $r->end == 30);
+ $range3->start(21);
+ ok(! defined $range->intersection([$range2, $range3]));
+ 
  ok !($range->contains($range2));
  ok !($range2->contains($range));
***************
*** 58,62 ****
  
  # testing strand
! my $range3 = Bio::Range->new(-start => 15,
                               -end => 25,
  									  -strand => 1);
--- 71,75 ----
  
  # testing strand
! $range3 = Bio::Range->new(-start => 15,
                               -end => 25,
  									  -strand => 1);



More information about the Bioperl-guts-l mailing list