test the pre-5.8.3 weak_ref setter code on newer perls too
Dagfinn Ilmari Mannsåker [Thu, 9 Aug 2012 02:06:15 +0000 (03:06 +0100)]
t/accessor-weaken-pre-5_8_3.t [new file with mode: 0644]

diff --git a/t/accessor-weaken-pre-5_8_3.t b/t/accessor-weaken-pre-5_8_3.t
new file mode 100644 (file)
index 0000000..03572a4
--- /dev/null
@@ -0,0 +1,13 @@
+use strictures 1;
+use Moo::_Utils;
+
+BEGIN {
+  no warnings 'redefine';
+  *Moo::_Utils::lt_5_8_3 = sub () { 1 };
+}
+
+(my $real_test = __FILE__) =~ s/-pre-5_8_3//;
+
+do $real_test;
+die $@ if $@;
+die $! if $!;