Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/proc/self/root/usr/share/doc/perl-Moose/t/attributes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/proc/self/root/usr/share/doc/perl-Moose/t/attributes/accessor_inlining.t
use strict;
use warnings;
use Test::More;

my $called;
{
    package Foo::Meta::Instance;
    use Moose::Role;

    sub is_inlinable { 0 }

    after get_slot_value => sub { $called++ };
}

{
    package Foo;
    use Moose;
    Moose::Util::MetaRole::apply_metaroles(
        for => __PACKAGE__,
        class_metaroles => {
            instance => ['Foo::Meta::Instance'],
        },
    );

    has foo => (is => 'ro');
}

my $foo = Foo->new(foo => 1);
is($foo->foo, 1, "got the right value");
is($called, 1, "reader was called");

done_testing;

Hry