From: Florian Ragwitz Date: Thu, 4 Dec 2008 02:42:31 +0000 (+0000) Subject: Add tests for RT#41255. X-Git-Tag: 0.71_01~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d25b8eca8fe155f776215f492d22b7715ae93d3;p=gitmo%2FClass-MOP.git Add tests for RT#41255. --- diff --git a/t/305_RT_41255.t b/t/305_RT_41255.t new file mode 100644 index 0000000..1dd1049 --- /dev/null +++ b/t/305_RT_41255.t @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +use strict; +use Test::More tests => 10; +use Test::Exception; + +use Class::MOP; + +{ + package Base; + sub m1 { 1 } + sub m2 { 2 } + sub m3 { 3 } + sub m4 { 4 } + sub m5 { 5 } + + package Derived; + use parent -norequire => qw(Base); + + sub m1; + sub m2 (); + sub m3 :method; + sub m4; m4() if 0; + sub m5; our $m5;; +} + +my $meta = Class::MOP::Class->initialize('Derived'); +my %methods = map { $_ => $meta->find_method_by_name($_) } 'm1' .. 'm5'; + +while (my ($name, $meta_method) = each %methods) { + is $meta_method->fully_qualified_name, "Derived::${name}"; + throws_ok { $meta_method->execute } qr/Undefined subroutine .* called at/; +}