-use Test::More tests => 48;
+use Test::More tests => 58;
use Test::Exception;
use strict;
use warnings;
+use Config;
use lib 't/lib';
# we test the pure-perl versions only, but allow overrides
lr2name => {
custom_field => "lr2'field",
},
+ fieldname_torture => {
+ custom_field => join ('', map { chr($_) } (0..255) ),
+ is_xs => $use_xs,
+ },
};
for my $name (sort keys %$test_accessors) {
my $ro_regex = $test_accessors->{$name}{is_xs}
? qr/Usage\:.+$name.*\(self\)/
- : qr/cannot alter the value of '\Q$field\E'/
+ : qr/$name(:?_accessor)?\Q' cannot alter its value (read-only attribute of class AccessorGroupsRO)/
;
- # die on set via name/alias
- throws_ok {
- $obj->$name('b');
- } $ro_regex;
-
- throws_ok {
- $obj->$alias('b');
- } $ro_regex;
+ {
+ local $TODO = "Class::XSAccessor emits broken error messages on 5.10 or -DDEBUGGING 5.8"
+ if (
+ $test_accessors->{$name}{is_xs}
+ and
+ $] < '5.011'
+ and
+ ( $] > '5.009' or $Config{config_args} =~ /DEBUGGING/ )
+ );
+
+ # die on set via name/alias
+ throws_ok {
+ $obj->$name('b');
+ } $ro_regex;
+
+ throws_ok {
+ $obj->$alias('b');
+ } $ro_regex;
+ }
# value should be unchanged
is($obj->$name, 'a');