all_from 'lib/Moose.pm';
license 'perl';
+use_ppport 3.19;
+
+requires_xs 'Class::MOP' => '0.92'; # for mop.h
+
requires 'Scalar::Util' => '1.19';
requires 'Carp';
-requires 'Class::MOP' => '0.92';
requires 'List::MoreUtils' => '0.12';
requires 'Sub::Exporter' => '0.980';
requires 'Task::Weaken' => '0';
use 5.008;
-our $VERSION = '0.89';
-$VERSION = eval $VERSION;
-our $AUTHORITY = 'cpan:STEVAN';
+use Class::MOP 0.92;
+
+BEGIN{
+ our $VERSION = '0.89';
+ $VERSION = eval $VERSION;
+ our $AUTHORITY = 'cpan:STEVAN';
+
+ require XSLoader;
+ XSLoader::load(__PACKAGE__, $VERSION);
+}
use Scalar::Util 'blessed';
use Carp 'confess';
use Moose::Exporter;
-use Class::MOP 0.92;
use Moose::Meta::Class;
use Moose::Meta::TypeConstraint;
return $attr->should_coerce;
}
-sub _generate_reader_method { shift->_generate_reader_method_inline(@_) }
-sub _generate_writer_method { shift->_generate_writer_method_inline(@_) }
-sub _generate_accessor_method { shift->_generate_accessor_method_inline(@_) }
-sub _generate_predicate_method { shift->_generate_predicate_method_inline(@_) }
-sub _generate_clearer_method { shift->_generate_clearer_method_inline(@_) }
+#sub _generate_reader_method { shift->_generate_reader_method_inline(@_) }
+#sub _generate_writer_method { shift->_generate_writer_method_inline(@_) }
+#sub _generate_accessor_method { shift->_generate_accessor_method_inline(@_) }
+#sub _generate_predicate_method { shift->_generate_predicate_method_inline(@_) }
+#sub _generate_clearer_method { shift->_generate_clearer_method_inline(@_) }
sub _inline_pre_body { '' }
sub _inline_post_body { '' }
\@Foo::calls,
[ [ $foo, 3, 2 ] ],
'trigger called correctly on set (with old value)',
- );
+ )
+ or do{ require Data::Dumper; diag(Data::Dumper::Dumper(\@Foo::calls)) };
@Foo::calls = ();
Foo->meta->make_immutable, redo if Foo->meta->is_mutable;
}
lives_ok {$obj->_foo(1)} "$class->_foo is writer";
is($obj->foo(), 1, "$class->foo is reader");
dies_ok {$obj->foo(2)} "$class->foo is not writer"; # this should fail
-ok(!defined $obj->_foo(), "$class->_foo is not reader");
+dies_ok {$obj->_foo()} "$class->_foo is not reader";
$class = make_class('ro', 'writer', 'Test::Class::WriterRO');
ok($class, "Can define attr with ro + writer");
lives_ok {$obj->_foo(1)} "$class->_foo is writer";
is($obj->foo(), 1, "$class->foo is reader");
dies_ok {$obj->foo(1)} "$class->foo is not writer";
-isnt($obj->_foo(), 1, "$class->_foo is not reader");
+dies_ok {$obj->_foo()} "$class->_foo is not reader";
$class = make_class('rw', 'accessor', 'Test::Class::AccessorRW');
ok($class, "Can define attr with rw + accessor");