6 use Test::More tests => 3;
13 This tests to make sure that the inlined constructor
14 has all the type constraints in order, even in the
15 cases when there is no type constraint available, such
16 as with a Class::MOP::Attribute object.
24 has 'foo' => (is => 'rw', isa => 'Int');
25 has 'baz' => (is => 'rw', isa => 'Int');
26 has 'zot' => (is => 'rw', isa => 'Int', init_arg => undef);
28 Foo->meta->add_attribute(
29 Class::MOP::Attribute->new(
36 Foo->meta->make_immutable(debug => 0);
40 Foo->new(foo => 10, bar => "Hello World", baz => 10, zot => 4);
41 } '... this passes the constuctor correctly';
44 Foo->new(foo => 10, bar => "Hello World", baz => 10, zot => "not an int");
45 } "... the constructor doesn't care about 'zot'";
48 Foo->new(foo => "Hello World", bar => 100, baz => "Hello World");
49 } '... this fails the constuctor correctly';