From c07503cbad4fdb922c08f00639cd27476f0015c7 Mon Sep 17 00:00:00 2001 From: Chris Fields Date: Tue, 19 Feb 2013 08:38:49 -0600 Subject: [PATCH] Graph::Directed is giving warnings when using 'require', but using actual module required is more direct w/o the warning --- Bio/Root/Test.pm | 18 +++++++++--------- t/Annotation/Annotation.t | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Bio/Root/Test.pm b/Bio/Root/Test.pm index 95fce7ad6..fafd1bb81 100644 --- a/Bio/Root/Test.pm +++ b/Bio/Root/Test.pm @@ -26,7 +26,7 @@ Bio::Root::Test - A common base for all Bioperl test scripts. my $do_network_tests = test_network(); my $output_debugging = test_debug(); - + # Bio::Root::Test rewraps Test::Most, so one can carry out tests with # Test::More, Test::Exception, Test::Warn, Test::Deep, Test::Diff syntax @@ -142,12 +142,12 @@ our @ISA = qw(Test::Builder::Module); { my $Tester = Test::Builder->new; - + no warnings 'redefine'; sub Test::Warn::_canonical_got_warning { my ($called_from, $msg) = @_; my $warn_kind = $called_from eq 'Carp' ? 'carped' : ($called_from =~ /Bio::/ ? 'Bioperl' : 'warn'); - + my $warning; if ($warn_kind eq 'Bioperl') { ($warning) = $msg =~ /\n--------------------- WARNING ---------------------\nMSG: (.+)\n---------------------------------------------------\n$/m; @@ -157,10 +157,10 @@ our @ISA = qw(Test::Builder::Module); my @warning_stack = split /\n/, $msg; # some stuff of uplevel is included $warning = $warning_stack[0]; } - + return {$warn_kind => $warning}; # return only the real message } - + sub Test::Warn::_diag_found_warning { foreach (@_) { if (ref($_) eq 'HASH') { @@ -173,12 +173,12 @@ our @ISA = qw(Test::Builder::Module); } $Tester->diag( "didn't find a warning" ) unless @_; } - + sub Test::Warn::_cmp_got_to_exp_warning { my ($got_kind, $got_msg) = %{ shift() }; my ($exp_kind, $exp_msg) = %{ shift() }; return 0 if ($got_kind eq 'warn') && ($exp_kind eq 'carped'); - + my $cmp; if ($got_kind eq 'Bioperl') { $cmp = $got_msg =~ /^\Q$exp_msg\E$/; @@ -186,7 +186,7 @@ our @ISA = qw(Test::Builder::Module); else { $cmp = $got_msg =~ /^\Q$exp_msg\E at \S+ line \d+\.?$/; } - + return $cmp; } } @@ -194,7 +194,7 @@ our @ISA = qw(Test::Builder::Module); our @EXPORT = (@Test::Most::EXPORT, #@Bio::Root::Test::Warn::EXPORT, # Test::Warn method wrappers - + # BioPerl-specific qw( test_begin diff --git a/t/Annotation/Annotation.t b/t/Annotation/Annotation.t index 2394b8a2b..1583f1aef 100644 --- a/t/Annotation/Annotation.t +++ b/t/Annotation/Annotation.t @@ -3,12 +3,12 @@ use strict; -BEGIN { +BEGIN { use lib '.'; use Bio::Root::Test; - + test_begin(-tests => 159); - + use_ok('Bio::Annotation::Collection'); use_ok('Bio::Annotation::DBLink'); use_ok('Bio::Annotation::Comment'); @@ -160,7 +160,7 @@ is (scalar($nested_ac->get_Annotations()), 7); is (scalar($nested_ac->get_all_Annotations()), 7); SKIP: { - test_skip(-tests => 7, -requires_modules => [qw(Graph::Directed Bio::Annotation::OntologyTerm)]); + test_skip(-tests => 7, -requires_modules => [qw(Bio::Annotation::OntologyTerm)]); use_ok('Bio::Annotation::OntologyTerm'); # OntologyTerm annotation my $termann = Bio::Annotation::OntologyTerm->new(-label => 'test case', @@ -252,7 +252,7 @@ my $ann_tree = Bio::Annotation::Tree->new( isa_ok($ann_tree, 'Bio::AnnotationI'); $ann_tree->tree_id('test'); is $ann_tree->tree_id(), 'test', "tree_id()"; -$ann_tree->tagname('tree'); +$ann_tree->tagname('tree'); is $ann_tree->tagname(), 'tree', "tagname()"; my $aln_filename = test_input_file('longnames.aln'); use Bio::AlignIO; @@ -311,7 +311,7 @@ my $ann_struct2 = Bio::Annotation::TagTree->new(-tagname => 'gn', -value => $val); is($ann_struct2->value, $val,'roundtrip'); -# formats +# formats like($ann_struct2->value, qr/Name: CALM1/,'itext'); $ann_struct2->tagformat('sxpr'); like($ann_struct2->value, qr/\(Name "CALM1"\)/,'spxr'); -- 2.11.4.GIT