X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fanalysis.t;h=d22a91bed2f25f21b9fcbbfe86186f8b060c017d;hb=09909f9d143c536799f29a2af0b8156122e26835;hp=19a6c50653fa3fdee6f0dc12ebcfacd85a6fc87f;hpb=f00cefe8896fd0f118dea165da64e9f178ee645b;p=scpubgit%2Fstemmatology.git diff --git a/t/analysis.t b/t/analysis.t index 19a6c50..d22a91b 100755 --- a/t/analysis.t +++ b/t/analysis.t @@ -17,6 +17,9 @@ 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 ); @@ -114,7 +117,12 @@ foreach my $row ( @{$results->{'variants'}} ) { } } else { # If not displaying, we're testing. - is( $row->{'genealogical'}, $expected{$row->{'id'}}, + # HACK to cope with formerly unuseful rows + unless( exists $expected{$row->{'id'}} ) { + $expected{$row->{'id'}} = 1; + } + my $gen_bool = $row->{'genealogical'} ? 1 : ''; + is( $gen_bool, $expected{$row->{'id'}}, "Got expected genealogical result for rank " . $row->{'id'} ); # If the row is genealogical, there should be one reading with no parents, # every reading should independently occur exactly once, and the total