The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more
1234567891011121314151617181920212223 use strict;use warnings;use Test::More;use Test::Moose;{ package Foo; use Moose; has foo => ( is => 'ro', isa => 'Maybe[Int]', default => undef, predicate => 'has_foo', );}with_immutable { is(Foo->new->foo, undef); ok(Foo->new->has_foo);} 'Foo';done_testing;
use
strict;
warnings;
Test::More;
Test::Moose;
{
package
Foo;
Moose;
has
foo
=> (
is
=>
'ro'
,
isa
'Maybe[Int]'
default
undef
predicate
'has_foo'
);
}
with_immutable {
is(Foo->new->foo,
ok(Foo->new->has_foo);
'Foo'
;
done_testing;