Subject: [PATCH @15047] Use of inherited AUTOLOAD for non-method
[p5sagit/p5-mst-13.2.git] / t / op / method.t
index 0d4e09b..0ce8ce8 100755 (executable)
@@ -9,7 +9,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..73\n";
+print "1..74\n";
 
 @A::ISA = 'B';
 @B::ISA = 'C';
@@ -249,4 +249,20 @@ test (
     ] || $@, 'ok'
 );
 
+# An autoloaded, inherited DESTROY may be invoked differently than normal
+# methods, and has been known to give rise to spurious warnings
+# eg <200203121600.QAA11064@gizmo.fdgroup.co.uk>
+
+{
+    use warnings;
+    my $w = '';
+    local $SIG{__WARN__} = sub { $w = $_[0] };
+
+    sub AutoDest::Base::AUTOLOAD {}
+    @AutoDest::ISA = qw(AutoDest::Base);
+    { my $x = bless {}, 'AutoDest'; }
+    $w =~ s/\n//g;
+    test($w, '');
+}
+
 print "# $cnt tests completed\n";