X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftext_tradition_collation.t;h=38b698bced0b3efc899e6ba6c577a476c9e14ead;hb=d4b75f4494467600ed48a036d3805d5cfb418394;hp=322cc39aff22570752076b00fba1ff6298b2cd61;hpb=508fd430d4411b209743d91556d5bca5ca89a8b3;p=scpubgit%2Fstemmatology.git diff --git a/t/text_tradition_collation.t b/t/text_tradition_collation.t index 322cc39..38b698b 100644 --- a/t/text_tradition_collation.t +++ b/t/text_tradition_collation.t @@ -56,6 +56,28 @@ my $t = Text::Tradition->new( ); my $c = $t->collation; +my @common = $c->calculate_common_readings(); +is( scalar @common, 8, "Found correct number of common readings" ); +my @marked = sort $c->common_readings(); +is( scalar @common, 8, "All common readings got marked as such" ); +my @expected = qw/ n1 n12 n16 n19 n20 n5 n6 n7 /; +is_deeply( \@marked, \@expected, "Found correct list of common readings" ); +} + + + +# =begin testing +{ +use Text::Tradition; + +my $cxfile = 't/data/Collatex-16.xml'; +my $t = Text::Tradition->new( + 'name' => 'inline', + 'input' => 'CollateX', + 'file' => $cxfile, + ); +my $c = $t->collation; + is( $c->common_predecessor( 'n9', 'n23' )->id, 'n20', "Found correct common predecessor" ); is( $c->common_successor( 'n9', 'n23' )->id,