X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F000_recipes%2Fbasics%2F003_binary_tree.t;fp=t%2F000_recipes%2Fbasics%2F003_binary_tree.t;h=ac037636132d99c46d65280b341e2982b362c580;hb=fa2985bc5c2b0fa59ea04904e89a035bf18a5bc6;hp=0f85f95571117e79d8f6c018030f5ae6352397d7;hpb=7ff5653479c2bfc0794635f7fbade9bfe7bb2381;p=gitmo%2FMoose.git diff --git a/t/000_recipes/basics/003_binary_tree.t b/t/000_recipes/basics/003_binary_tree.t index 0f85f95..ac03763 100644 --- a/t/000_recipes/basics/003_binary_tree.t +++ b/t/000_recipes/basics/003_binary_tree.t @@ -12,37 +12,37 @@ use Scalar::Util 'isweak'; package BinaryTree; use Moose; - has 'node' => (is => 'rw', isa => 'Any'); + has 'node' => ( is => 'rw', isa => 'Any' ); has 'parent' => ( - is => 'rw', - isa => 'BinaryTree', + is => 'rw', + isa => 'BinaryTree', predicate => 'has_parent', - weak_ref => 1, + weak_ref => 1, ); has 'left' => ( - is => 'rw', - isa => 'BinaryTree', - predicate => 'has_left', + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_left', lazy => 1, - default => sub { BinaryTree->new(parent => $_[0]) }, + default => sub { BinaryTree->new( parent => $_[0] ) }, ); has 'right' => ( - is => 'rw', - isa => 'BinaryTree', - predicate => 'has_right', - lazy => 1, - default => sub { BinaryTree->new(parent => $_[0]) }, + is => 'rw', + isa => 'BinaryTree', + predicate => 'has_right', + lazy => 1, + default => sub { BinaryTree->new( parent => $_[0] ) }, ); before 'right', 'left' => sub { - my ($self, $tree) = @_; - $tree->parent($self) if defined $tree; - }; - - __PACKAGE__->meta->make_immutable(debug => 0); + my ( $self, $tree ) = @_; + $tree->parent($self) if defined $tree; + }; + + __PACKAGE__->meta->make_immutable( debug => 0 ); } my $root = BinaryTree->new(node => 'root');