From: Tara L Andrews Date: Wed, 18 Apr 2012 12:30:09 +0000 (+0200) Subject: fix failing tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmatology.git;a=commitdiff_plain;h=18f48b82060e4c183d100c352bf2d212094a2fa8 fix failing tests --- diff --git a/lib/Text/Tradition/Analysis.pm b/lib/Text/Tradition/Analysis.pm index b81111a..7777c6c 100644 --- a/lib/Text/Tradition/Analysis.pm +++ b/lib/Text/Tradition/Analysis.pm @@ -110,7 +110,8 @@ foreach my $row ( @{$data->{'variants'}} ) { unless( exists $expected_genealogical{$row->{'id'}} ) { $expected_genealogical{$row->{'id'}} = 1; } - is( $row->{'genealogical'}, $expected_genealogical{$row->{'id'}}, + my $gen_bool = $row->{'genealogical'} ? 1 : 0; + is( $gen_bool, $expected_genealogical{$row->{'id'}}, "Got correct genealogical flag for row " . $row->{'id'} ); # Check that we have the right row with the right groups my $rank = $row->{'id'}; diff --git a/t/analysis.t b/t/analysis.t index d22a91b..30c3852 100755 --- a/t/analysis.t +++ b/t/analysis.t @@ -17,9 +17,6 @@ my $tradition = Text::Tradition->new( 'file' => 't/data/besoin.xml' ); $tradition->add_stemma( 'dotfile' => 't/data/besoin.dot' ); -# Hack to avoid warning -$tradition->collation->add_relationship( '493,2', '493,3', {'type'=>'orthographic'} ); - # Run the analysis of the tradition my $results = run_analysis( $tradition ); diff --git a/t/text_tradition_analysis.t b/t/text_tradition_analysis.t index 5c23af6..4828b68 100644 --- a/t/text_tradition_analysis.t +++ b/t/text_tradition_analysis.t @@ -56,7 +56,8 @@ foreach my $row ( @{$data->{'variants'}} ) { unless( exists $expected_genealogical{$row->{'id'}} ) { $expected_genealogical{$row->{'id'}} = 1; } - is( $row->{'genealogical'}, $expected_genealogical{$row->{'id'}}, + my $gen_bool = $row->{'genealogical'} ? 1 : 0; + is( $gen_bool, $expected_genealogical{$row->{'id'}}, "Got correct genealogical flag for row " . $row->{'id'} ); # Check that we have the right row with the right groups my $rank = $row->{'id'};