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;
24 __PACKAGE__->meta->make_immutable;
31 __PACKAGE__->meta->make_immutable;
34 foreach my $class qw(Foo Bar) {
35 is( $class->new->bar, undef, "no args" );
36 is( $class->new( bar => 42 )->bar, 42, "normal args" );
37 is( $class->new( 37 )->bar, 37, "single arg" );
39 my $o = $class->new(bar => 42, baz => 47);
40 is($o->bar, 42, '... got the right bar');
41 is($o->baz, 47, '... got the right bar');
44 my $o = $class->new(42, baz => 47);
45 is($o->bar, 42, '... got the right bar');
46 is($o->baz, 47, '... got the right bar');