our $VERSION = '0.68';
- my $xs = !(exists $INC{'Mouse/PurePerl.pm'} || $ENV{MOUSE_PUREPERL} || $ENV{PERL_ONLY});
+ my $xs = !(defined(&is_valid_class_name) || $ENV{MOUSE_PUREPERL} || $ENV{PERL_ONLY});
# Because Mouse::Util is loaded first in all the Mouse sub-modules,
# XSLoader must be placed here, not in Mouse.pm.
use strict;
use warnings;
-use Mouse ();
use Test::More tests => 25;
use Test::Exception;
+use Mouse ();
+
# error handling
throws_ok {
Mouse::Meta::Class->create(
use strict;
use warnings;
+use Test::More tests => 1;
+use Test::Exception;
+
{
package ParentClass;
use Mouse;
use Mouse;
}
-use Test::More tests => 1;
-use Test::Exception;
-
lives_ok {
Mouse->init_meta(for_class => 'SomeClass');
} 'Mouse class => use base => Mouse Class, then Mouse->init_meta on middle class ok';
+use strict;
+use Test::More tests => 4;
+
package Foo;
use Mouse;
sub _build_foo { undef }
package main;
-use Test::More tests => 4;
ok ( !defined(Foo->new->bar), 'NonLazyBuild: Undef default' );
ok ( !defined(Foo->new->bar(undef)), 'NonLazyBuild: Undef explicit' );
## This test fails at the time of creation.
ok ( !defined(Foo->new->foo(undef)), 'LazyBuild: Undef explicit' );
-
-
-1;
+use Test::More tests => 4;
+
package MyRole;
use Mouse::Role;
package main;
-use Test::More tests => 4;
-
{
local $TODO = 'Role composition does not clone methods yet';
is(MyClass1->foo, 'MyClass1::foo',
# See also http://rt.cpan.org/Public/Bug/Display.html?id=55048
-package MyInteger;
-use Mouse;
+use strict;
+use Test::More tests => 24;
-has a_int => (
- is => 'rw',
- isa => 'Int',
-);
+{
+ package MyInteger;
+ use Mouse;
-has a_num => (
- is => 'rw',
- isa => 'Num',
-);
+ has a_int => (
+ is => 'rw',
+ isa => 'Int',
+ );
-package main;
-use Test::More tests => 24;
+ has a_num => (
+ is => 'rw',
+ isa => 'Num',
+ );
+}
foreach my $i(2**32, 2**40, 2**46) {
for my $sig(1, -1) {