Skip to content

Commit

Permalink
fix reverse method
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakim Cassimally committed May 30, 2011
1 parent 5b44784 commit c1c3aa1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scratch/perl/text-piecetable/lib/Tree/BinaryFP.pm
Expand Up @@ -18,8 +18,8 @@ sub reverse {
my $self = shift;
return $self->new({
%$self,
left => $self->right,
right => $self->left,
left => $self->right->reverse,
right => $self->left->reverse,
});
}
sub mk_node {
Expand Down
3 changes: 3 additions & 0 deletions scratch/perl/text-piecetable/t/04-tree-fp.t
Expand Up @@ -54,6 +54,9 @@ sub test_match {
test_match( $node, 0, e(d,f), 'e(d,f)' );
my ($e, $f, $d) =
test_match( $node, 1, e(f,d), 'e(f,d)' );
test_match( $node, 1, e(f,any), 'e(f,any)' );

test_match( $node, 1, e(any,f)->reverse, 'e(any,f)->reverse' );
test_match( $node, 1, e(d,f)->reverse, 'e(d,f)->reverse' );
test_match( $node, 1, e(undef,d), 'e(undef,d)' );
test_match( $node, 1, e(f,undef), 'e(f,undef)' );
Expand Down

0 comments on commit c1c3aa1

Please sign in to comment.