projects
/
gitmo/Class-C3-XS.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
avoid needing . in @INC in dev mode
[gitmo/Class-C3-XS.git]
/
t
/
34_next_method_in_eval.t
1
use strict;
2
use warnings;
3
4
use Test::More tests => 1;
5
6
use Class::C3::XS;
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
17
sub foo {
18
die 'A::foo died';
19
return 'A::foo succeeded';
20
}
21
}
22
23
{
24
package B;
25
use base 'A';
26
27
sub foo {
28
eval {
29
return 'B::foo => ' . (shift)->next::method();
30
};
31
32
if ($@) {
33
return $@;
34
}
35
}
36
}
37
38
like(B->foo,
39
qr/^A::foo died/,
40
'method resolved inside eval{}');
41
42