X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftext_tradition.t;h=2c7be1b5afa39b29fcf290a51b8f7f23f82b55d8;hb=32256f01d018a2a5799e706c57edef4680b3a276;hp=eae4e3a341134fef7a1e361013af87c3a7dc3ecf;hpb=56cf65bd9ea030e1e7e0cc0bd77673e4f5f00bc8;p=scpubgit%2Fstemmatology.git diff --git a/t/text_tradition.t b/t/text_tradition.t index eae4e3a..2c7be1b 100644 --- a/t/text_tradition.t +++ b/t/text_tradition.t @@ -33,7 +33,7 @@ if( $wit_a ) { is( $s->witness('X'), undef, "There is no witness X" ); ok( !exists $s->{'witnesses'}->{'X'}, "Witness key X not created" ); -my $wit_d = $s->add_witness( 'sigil' => 'D' ); +my $wit_d = $s->add_witness( 'sigil' => 'D', 'sourcetype' => 'collation' ); is( ref( $wit_d ), 'Text::Tradition::Witness', "new witness created" ); is( $wit_d->sigil, 'D', "witness has correct sigil" ); is( scalar $s->witnesses, 4, "object now has four witnesses" ); @@ -57,10 +57,12 @@ my $t = Text::Tradition->new( 'file' => 't/data/simple.txt', ); +is( $t->stemma_count, 0, "No stemmas added yet" ); my $s; -ok( $s = $t->add_stemma( 't/data/simple.dot' ), "Added a simple stemma" ); +ok( $s = $t->add_stemma( dotfile => 't/data/simple.dot' ), "Added a simple stemma" ); is( ref( $s ), 'Text::Tradition::Stemma', "Got a stemma object returned" ); -is( $t->stemma, $s, "Stemma is the right one" ); +is( $t->stemma_count, 1, "Tradition claims to have a stemma" ); +is( $t->stemma(0), $s, "Tradition hands back the right stemma" ); }