From: Tara L Andrews Date: Fri, 6 Apr 2012 20:34:47 +0000 (+0200) Subject: bugfix in directory test script X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09909f9d143c536799f29a2af0b8156122e26835;p=scpubgit%2Fstemmatology.git bugfix in directory test script --- diff --git a/lib/Text/Tradition/Directory.pm b/lib/Text/Tradition/Directory.pm index 7bfba71..2a1bffa 100644 --- a/lib/Text/Tradition/Directory.pm +++ b/lib/Text/Tradition/Directory.pm @@ -143,8 +143,8 @@ is( ref( $nt ), 'Text::Tradition', "Made new tradition" ); my $scope = $g->new_scope; is( scalar $g->traditionlist, 1, "Now one object in new directory index" ); my $ntobj = $g->tradition( 'CX' ); - my @w1 = sort $ntobj->witnesses; - my @w2 = sort( $nt->witnesses ); + my @w1 = sort { $a->sigil cmp $b->sigil } $ntobj->witnesses; + my @w2 = sort{ $a->sigil cmp $b->sigil } $nt->witnesses; is_deeply( \@w1, \@w2, "Looked up remaining tradition by name" ); } diff --git a/t/text_tradition_directory.t b/t/text_tradition_directory.t index de455ea..8950148 100644 --- a/t/text_tradition_directory.t +++ b/t/text_tradition_directory.t @@ -90,8 +90,8 @@ is( ref( $nt ), 'Text::Tradition', "Made new tradition" ); my $scope = $g->new_scope; is( scalar $g->traditionlist, 1, "Now one object in new directory index" ); my $ntobj = $g->tradition( 'CX' ); - my @w1 = sort $ntobj->witnesses; - my @w2 = sort( $nt->witnesses ); + my @w1 = sort { $a->sigil cmp $b->sigil } $ntobj->witnesses; + my @w2 = sort{ $a->sigil cmp $b->sigil } $nt->witnesses; is_deeply( \@w1, \@w2, "Looked up remaining tradition by name" ); } }