X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftext_tradition_collation.t;h=f9d07fb747f8c14debe05c64522fdf8525f4f7d9;hb=b365fbaeead920ab613f87b331a393e72c5d033e;hp=099f61248c4f421b0f62295647482be92135f0ac;hpb=ba99519aa11f30b5acfe7e1a6c0d18d8fdb14bce;p=scpubgit%2Fstemmatology.git diff --git a/t/text_tradition_collation.t b/t/text_tradition_collation.t index 099f612..f9d07fb 100644 --- a/t/text_tradition_collation.t +++ b/t/text_tradition_collation.t @@ -56,6 +56,31 @@ my $t = Text::Tradition->new( ); my $c = $t->collation; +# Make an svg +my $svg = $c->as_svg; +is( substr( $svg, 0, 5 ), 'has_cached_svg, "SVG was cached" ); +is( $c->as_svg, $svg, "Cached SVG returned upon second call" ); +$c->calculate_ranks; +is( $c->as_svg, $svg, "Cached SVG retained with no rank change" ); +$c->add_relationship( 'n9', 'n23', { 'type' => 'spelling' } ); +isnt( $c->as_svg, $svg, "SVG changed after relationship add" ); +} + + + +# =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; + isnt( $c->reading('n23')->rank, $c->reading('n9')->rank, "Rank skew exists" ); $c->add_relationship( 'n23', 'n9', { 'type' => 'collated', 'scope' => 'local' } ); is( scalar $c->relationships, 4, "Found all expected relationships" );