Subject: | Writers behave inconsistently based on MOO_XS_DISABLE |
Class::XSAccessor-generated writers behave differently from Moo's pure Perl writers.
The attached test case will demonstrate the issue... 50% of the time.
Subject: | moo-setters-inconsistent.t |
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Fatal;
BEGIN { $ENV{MOO_XS_DISABLE} = int(rand(2)) };
package Foo {
use Moo;
has foo => (is => "bare", reader => "get_foo", writer => "set_foo");
};
is(exception { Foo->new->set_foo }, undef);
done_testing;