generate README at dist built time rather than configure time
[p5sagit/Class-Accessor-Grouped.git] / t / accessors_ro.t
index 7b385a2..33d3f38 100644 (file)
@@ -1,8 +1,8 @@
-use Test::More tests => 58;
+use Test::More;
 use Test::Exception;
 use strict;
 use warnings;
-use Config;
+no warnings 'once';
 use lib 't/lib';
 
 # we test the pure-perl versions only, but allow overrides
@@ -53,7 +53,7 @@ my $test_accessors = {
     custom_field => "lr2'field",
   },
   fieldname_torture => {
-    custom_field => join ('', map { chr($_) } (1..255) ), # FIXME after RT#80569 is fixed 0..255 should work
+    custom_field => join ('', map { chr($_) } (0..255) ),
     is_xs => $use_xs,
   },
 };
@@ -80,18 +80,15 @@ 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)/
   ;
 
-  {
-    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/ )
-      );
+  SKIP: {
+    skip "Class::XSAccessor emits broken error messages on 5.10 and earlier", 1 if (
+      $test_accessors->{$name}{is_xs}
+        and
+      $] < '5.011'
+    );
 
     # die on set via name/alias
     throws_ok {
@@ -108,5 +105,4 @@ for my $name (sort keys %$test_accessors) {
   is($obj->$alias, 'a');
 };
 
-#important
-1;
+done_testing unless $::SUBTESTING;