projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Update IO to CPAN 1.24 release
[p5sagit/p5-mst-13.2.git]
/
t
/
mro
/
next_ineval.t
1
#!/usr/bin/perl
2
3
use strict;
4
use warnings;
5
6
require q(./test.pl); plan(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 mro '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 mro '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
like(B->foo,
41
qr/^A::foo died/,
42
'method resolved inside eval{}');
43
44