2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
15 has bar => ( is => "rw" );
16 has baz => ( is => "rw" );
19 my ( $self, @args ) = @_;
20 unshift @args, "bar" if @args % 2 == 1;
30 foreach my $class qw(Foo Bar) {
31 is( $class->new->bar, undef, "no args" );
32 is( $class->new( bar => 42 )->bar, 42, "normal args" );
33 is( $class->new( 37 )->bar, 37, "single arg" );
35 my $o = $class->new(bar => 42, baz => 47);
36 is($o->bar, 42, '... got the right bar');
37 is($o->baz, 47, '... got the right bar');
40 my $o = $class->new(42, baz => 47);
41 is($o->bar, 42, '... got the right bar');
42 is($o->baz, 47, '... got the right bar');