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