blob: b8d03160aef42c5ce840cabada9bf1d3283aab30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!./perl
BEGIN {
unless (-d 'blib') {
chdir 't' if -d 't';
@INC = '../lib';
}
}
use strict;
use warnings;
require q(./test.pl); plan(tests => 4);
{
package New;
use strict;
use warnings;
package Old;
use strict;
use warnings;
{
no strict 'refs';
*{'Old::'} = *{'New::'};
}
}
ok (Old->isa (New::), 'Old inherits from New');
ok (New->isa (Old::), 'New inherits from Old');
isa_ok (bless ({}, Old::), New::, 'Old object');
isa_ok (bless ({}, New::), Old::, 'New object');
|