[Bioperl-guts-l] [15430] bioperl-network/trunk/t: removed extraneous syntax; better use of Bio::Root::Test syntax

Senduran Balasubramaniam sendu at dev.open-bio.org
Thu Jan 22 06:07:51 EST 2009


Revision: 15430
Author:   sendu
Date:     2009-01-22 06:07:51 -0500 (Thu, 22 Jan 2009)

Log Message:
-----------
removed extraneous syntax; better use of Bio::Root::Test syntax

Modified Paths:
--------------
    bioperl-network/trunk/t/Edge.t
    bioperl-network/trunk/t/Graph-Articulation.x
    bioperl-network/trunk/t/Graph-MD5.t
    bioperl-network/trunk/t/Graph-Seq.t
    bioperl-network/trunk/t/IO_dip_tab.t
    bioperl-network/trunk/t/IO_psi10.t
    bioperl-network/trunk/t/IO_psi25.t
    bioperl-network/trunk/t/Interaction.t
    bioperl-network/trunk/t/Node.t
    bioperl-network/trunk/t/ProteinNet.t

Modified: bioperl-network/trunk/t/Edge.t
===================================================================
--- bioperl-network/trunk/t/Edge.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/Edge.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,16 +2,12 @@
 # Bioperl Test Harness Script for Modules
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-	
-	use lib ".";
 	use Bio::Root::Test;
-	test_begin(-tests => 11,
-				  -requires_module => 'Graph');
+	test_begin(-tests => 10,
+			   -requires_module => 'Graph');
 
 	use_ok('Bio::Network::ProteinNet');
 	use_ok('Bio::Network::Edge');
@@ -19,11 +15,8 @@
 	use_ok('Bio::Seq');
 }
 
-my $verbose = 0;
-$verbose = 1 if $DEBUG;
+my $verbose = test_debug();
 
-ok 1;
-
 my $seq1 = Bio::Seq->new(-seq => "aaaaaaa");
 my $seq2 = Bio::Seq->new(-seq => "ttttttt");
 my $seq3 = Bio::Seq->new(-seq => "ccccccc");

Modified: bioperl-network/trunk/t/Graph-Articulation.x
===================================================================
--- bioperl-network/trunk/t/Graph-Articulation.x	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/Graph-Articulation.x	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,23 +2,18 @@
 # Bioperl Test Harness Script for Modules
 # $Id: Node.t 14466 2008-02-04 05:15:58Z bosborne $
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-
-	use lib ".";
 	use Bio::Root::Test;
 	test_begin(-tests => 53,
-				  -requires_module => 'Graph');
+			   -requires_module => 'Graph');
 
 	use_ok('Bio::Network::IO');
 	use_ok('Bio::Network::Node');
 }
 
-my $verbose = 0;
-$verbose = 1 if $DEBUG;
+my $verbose = test_debug();
 
 # tests for Graph's problematic articulation_points()
 # As of 2/2008 this test suite is still not reliably passing -
@@ -30,7 +25,7 @@
 #
 my $io = Bio::Network::IO->new(
   -format => 'dip_tab',
-  -file   => Bio::Root::IO->catfile("t","data","tab1part.tab"),
+  -file   => test_input_file("tab1part.tab"),
   -threshold => 0.6);
 ok(defined $io);
 ok my $g1 = $io->next_network();
@@ -45,7 +40,7 @@
 #
 $io = Bio::Network::IO->new
 (-format => 'psi10',
- -file   => Bio::Root::IO->catfile("t","data","bovin_small_intact.xml"));
+ -file   => test_input_file("bovin_small_intact.xml"));
 my $g = $io->next_network();
 
 @nodes = $g->nodes;
@@ -73,7 +68,7 @@
 #
 ok $io = Bio::Network::IO->new
   (-format => 'psi10',
-	-file   => Bio::Root::IO->catfile("t", "data", "arath_small-02.xml"));
+	-file   => test_input_file("arath_small-02.xml"));
 ok $g1 = $io->next_network();
 ok $g1->nodes == 73;
 ok $g1->interactions == 516;

Modified: bioperl-network/trunk/t/Graph-MD5.t
===================================================================
--- bioperl-network/trunk/t/Graph-MD5.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/Graph-MD5.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,16 +2,12 @@
 # Bioperl Test Harness Script for Modules#
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-
-	use lib ".";
 	use Bio::Root::Test;
 	test_begin(-tests => 23,
-				  -requires_module => 'Digest::MD5' );
+			   -requires_module => 'Digest::MD5');
 
  	use_ok('Graph::Undirected');
 }

Modified: bioperl-network/trunk/t/Graph-Seq.t
===================================================================
--- bioperl-network/trunk/t/Graph-Seq.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/Graph-Seq.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,16 +2,12 @@
 # Bioperl Test Harness Script for Modules#
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-
-	use lib ".";
 	use Bio::Root::Test;
 	test_begin(-tests => 21,
-				  -requires_module => 'Graph');
+			   -requires_module => 'Graph');
 
 	use_ok('Graph::Undirected');
 	use_ok('Graph::Traversal::DFS');

Modified: bioperl-network/trunk/t/IO_dip_tab.t
===================================================================
--- bioperl-network/trunk/t/IO_dip_tab.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/IO_dip_tab.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,16 +2,12 @@
 # Bioperl Test Harness Script for Modules
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-
-	use lib ".";
 	use Bio::Root::Test;
-	test_begin(-tests => 20,
-				  -requires_module => 'Graph');
+	test_begin(-tests => 19,
+			   -requires_module => 'Graph');
 
 	use_ok('Bio::Network::IO');
 	use_ok('Bio::Network::Edge');
@@ -19,17 +15,14 @@
 	use_ok('Bio::Seq');
 }
 
-my $verbose = 0;
-$verbose = 1 if $DEBUG;
+my $verbose = test_debug();
 
-ok 1;
-
 #
 # read new DIP format
 #
 my $io = Bio::Network::IO->new(
     -format => 'dip_tab',
-    -file   => Bio::Root::IO->catfile("t","data","tab4part.tab"));
+    -file   => test_input_file("tab4part.tab"));
 my $g1 = $io->next_network();
 ok $g1->edges == 5;
 ok $g1->vertices == 7;
@@ -38,7 +31,7 @@
 #
 $io = Bio::Network::IO->new(
   -format => 'dip_tab',
-  -file   => Bio::Root::IO->catfile("t","data","tab1part.tab"),
+  -file   => test_input_file("tab1part.tab"),
   -threshold => 0.6);
 ok(defined $io);
 ok $g1 = $io->next_network();
@@ -54,9 +47,10 @@
 #
 # test write to filehandle...
 #
+my $out_file = test_output_file();
 my $out =  Bio::Network::IO->new(
   -format => 'dip_tab',
-  -file   => ">". Bio::Root::IO->catfile("t","data","out.tab"));
+  -file   => ">".$out_file);
 ok(defined $out);
 ok $out->write_network($g1);
 #
@@ -64,7 +58,7 @@
 #
 my $io2 = Bio::Network::IO->new(
   -format   => 'dip_tab',
-  -file     => Bio::Root::IO->catfile("t","data","out.tab"));
+  -file     => $out_file);
 ok defined $io2;
 ok	my $g2 = $io2->next_network();
 ok $node = $g2->get_nodes_by_id('PIR:A64696');

Modified: bioperl-network/trunk/t/IO_psi10.t
===================================================================
--- bioperl-network/trunk/t/IO_psi10.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/IO_psi10.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,32 +2,25 @@
 # Bioperl Test Harness Script for Modules#
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-
-	use lib ".";
 	use Bio::Root::Test;
-	test_begin(-tests => 22,
-				  -requires_module => 'Graph',
-				  -requires_module => 'XML::Twig' );
+	test_begin(-tests => 21,
+			   -requires_module => 'Graph',
+			   -requires_module => 'XML::Twig');
 
 	use_ok('Bio::Network::IO');
 }
 
-my $verbose = 0;
-$verbose = 1 if $DEBUG;
+my $verbose = test_debug();
 
-ok 1;
-
 #
 # PSI XML from DIP
 #
 ok my $io = Bio::Network::IO->new
   (-format => 'psi10',
-	-file   => Bio::Root::IO->catfile("t", "data", "psi_xml.dat"));
+	-file   => test_input_file("psi_xml.dat"));
 ok my $g1 = $io->next_network();
 ok $g1->edge_count == 3;
 ok $g1->node_count == 4;
@@ -47,7 +40,7 @@
 #
 ok $io = Bio::Network::IO->new
   (-format => 'psi10',
-	-file   => Bio::Root::IO->catfile("t", "data", "sv40_small.xml"));
+	-file   => test_input_file("sv40_small.xml"));
 ok $g1 = $io->next_network();
 ok $g1->edge_count == 3;
 ok $g1->node_count == 5;
@@ -81,7 +74,7 @@
 #
 ok $io = Bio::Network::IO->new
   (-format => 'psi10',
-	-file   => Bio::Root::IO->catfile("t", "data", "00001.xml"));
+	-file   => test_input_file("00001.xml"));
 # ok $g1 = $io->next_network(); 
 # The individual files from HPRD are not standard PSI, problems parsing them
 

Modified: bioperl-network/trunk/t/IO_psi25.t
===================================================================
--- bioperl-network/trunk/t/IO_psi25.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/IO_psi25.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,31 +2,25 @@
 # Bioperl Test Harness Script for Modules#
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-	use lib ".";
 	use Bio::Root::Test;
-	test_begin(-tests => 10,
-				  -requires_module => 'Graph',
-				  -requires_module => 'XML::Twig' );
+	test_begin(-tests => 9,
+			   -requires_module => 'Graph',
+			   -requires_module => 'XML::Twig');
 
 	use_ok('Bio::Network::IO');
 }
 
-my $verbose = 0;
-$verbose = 1 if $DEBUG;
+my $verbose = test_debug();
 
-ok 1;
-
 #
 # PSI XML from IntAct
 #
 ok my $io = Bio::Network::IO->new
   (-format  => 'psi25',
-	-file    => Bio::Root::IO->catfile("t", "data", "human_small-01.xml"),
+	-file    => test_input_file("human_small-01.xml"),
    -verbose => $verbose );
 ok my $g1 = $io->next_network(); 
 ok $g1->node_count == 646;
@@ -37,7 +31,7 @@
 #
 ok $io = Bio::Network::IO->new
   (-format => 'psi25',
-	-file   => Bio::Root::IO->catfile("t", "data", "Viruses.psi25.xml"),
+	-file   => test_input_file("Viruses.psi25.xml"),
    -verbose => $verbose );
 ok $g1 = $io->next_network(); 
 ok $g1->node_count == 521;

Modified: bioperl-network/trunk/t/Interaction.t
===================================================================
--- bioperl-network/trunk/t/Interaction.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/Interaction.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,15 +2,12 @@
 # Bioperl Test Harness Script for Modules
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-	use lib ".";
 	use Bio::Root::Test;
-	test_begin(-tests => 23,
-				  -requires_module => 'Graph');
+	test_begin(-tests => 22,
+			   -requires_module => 'Graph');
 
 	use_ok('Bio::Network::ProteinNet');
 	use_ok('Bio::Network::Interaction');
@@ -20,11 +17,8 @@
 	use_ok('Bio::Annotation::OntologyTerm');
 }
 
-my $verbose = 0;
-$verbose = 1 if $DEBUG;
+my $verbose = test_debug();
 
-ok 1;
-
 my $g = Bio::Network::ProteinNet->new();
 
 my $seq1 = Bio::Seq->new(-seq => "aaaaaaa");

Modified: bioperl-network/trunk/t/Node.t
===================================================================
--- bioperl-network/trunk/t/Node.t	2009-01-22 10:50:52 UTC (rev 15429)
+++ bioperl-network/trunk/t/Node.t	2009-01-22 11:07:51 UTC (rev 15430)
@@ -2,26 +2,20 @@
 # Bioperl Test Harness Script for Modules
 # $Id$
 
-use vars qw($NUMTESTS $DEBUG $ERROR);
 use strict;
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 
 BEGIN {
-	use lib ".";
 	use Bio::Root::Test;
-	test_begin(-tests => 33,
-				  -requires_module => 'Graph');

@@ Diff output truncated at 10000 characters. @@



More information about the Bioperl-guts-l mailing list