X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmatology.git;a=blobdiff_plain;f=t%2Ftext_tradition_collation.t;h=fc7abe1202aaca30e38c7c3236dc3395651c6bb1;hp=b0070d4f01266727fd0da10a95a12388ff120c76;hb=9fef629bd3a741a6d74d130f10056898d504fb47;hpb=f7ff202ce1b5c064d0851ad8338e0c1802e988ce diff --git a/t/text_tradition_collation.t b/t/text_tradition_collation.t index b0070d4..fc7abe1 100644 --- a/t/text_tradition_collation.t +++ b/t/text_tradition_collation.t @@ -85,12 +85,22 @@ is( scalar $st->collation->readings, $READINGS, "Reparsed collation has all read is( scalar $st->collation->paths, $PATHS, "Reparsed collation has all paths" ); is( scalar $st->collation->relationships, 3, "Reparsed collation has new relationships" ); -# Now add a stemma, write to GraphML, and parse again. +# Now add a stemma, write to GraphML, and look at the output. my $stemma = $tradition->add_stemma( 'dotfile' => 't/data/florilegium.dot' ); is( ref( $stemma ), 'Text::Tradition::Stemma', "Parsed dotfile into stemma" ); is( $tradition->stemmata, 1, "Tradition now has the stemma" ); $graphml = $c->as_graphml; like( $graphml, qr/digraph/, "Digraph declaration exists in GraphML" ); + +# Now add a user, write to GraphML, and look at the output. +unlike( $graphml, qr/testuser/, "Test user name does not exist in GraphML yet" ); +my $testuser = Text::Tradition::User->new( + id => 'testuser', password => 'testpass' ); +is( ref( $testuser ), 'Text::Tradition::User', "Created test user object" ); +$testuser->add_tradition( $tradition ); +is( $tradition->user->id, $testuser->id, "Tradition assigned to test user" ); +$graphml = $c->as_graphml; +like( $graphml, qr/testuser/, "Test user name now exists in GraphML" ); }