fix broken gotos for Catalyst::Plugin::C3, added slightly modified next::method tests...
[gitmo/Class-C3-XS.git] / t / 34_next_method_in_eval.t
CommitLineData
2605e591 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7
8BEGIN { use_ok('Class::C3::XS') }
9
10=pod
11
12This tests the use of an eval{} block to wrap a next::method call.
13
14=cut
15
16{
17 package A;
18
19 sub foo {
20 die 'A::foo died';
21 return 'A::foo succeeded';
22 }
23}
24
25{
26 package B;
27 use base 'A';
28
29 sub foo {
30 eval {
31 return 'B::foo => ' . (shift)->next::method();
32 };
33
34 if ($@) {
35 return $@;
36 }
37 }
38}
39
40like(B->foo,
41 qr/^A::foo died/,
42 'method resolved inside eval{}');
43
44