X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftext_tradition_analysis.t;h=fe8ef2f2868f0de54ea95357c448b1e5be7ed844;hb=f00cefe8896fd0f118dea165da64e9f178ee645b;hp=7c9161e2a00481f7a151594bb84e3c856a4d2d62;hpb=bebec0e9db285a2161d08667ba98fa3bcb91d9e4;p=scpubgit%2Fstemmatology.git diff --git a/t/text_tradition_analysis.t b/t/text_tradition_analysis.t index 7c9161e..fe8ef2f 100644 --- a/t/text_tradition_analysis.t +++ b/t/text_tradition_analysis.t @@ -18,9 +18,42 @@ my $tradition = Text::Tradition->new( 'input' => 'TEI', my $s = $tradition->add_stemma( 'dotfile' => 't/data/florilegium.dot' ); is( ref( $s ), 'Text::Tradition::Stemma', "Added stemma to tradition" ); +my %expected_genealogical = ( + 1 => '', + 2 => 1, + 3 => '', + 5 => '', + 7 => '', + 8 => '', + 10 => '', + 13 => 1, + 33 => '', + 34 => '', + 37 => '', + 60 => '', + 81 => 1, + 84 => '', + 87 => '', + 101 => '', + 102 => '', + 122 => 1, + 157 => '', + 166 => 1, + 169 => 1, + 200 => 1, + 216 => 1, + 217 => 1, + 219 => 1, + 241 => 1, + 242 => 1, + 243 => 1, +); + my $data = run_analysis( $tradition ); -# TODO Check genealogical count -is( $data->{'genealogical_count'}, 13, "Got right genealogical count" ); +foreach my $row ( @{$data->{'variants'}} ) { + is( $row->{'genealogical'}, $expected_genealogical{$row->{'id'}}, + "Got correct genealogical flag for row " . $row->{'id'} ); +} is( $data->{'conflict_count'}, 16, "Got right conflict count" ); is( $data->{'variant_count'}, 28, "Got right total variant number" ); }