Commit | Line | Data |
---|---|---|
1ccdb730 NC |
1 | my @symbols; |
2 | BEGIN { | |
b5efbd1f | 3 | chdir 't' if -d 't'; |
fa71130c | 4 | require './test.pl'; |
273be65c | 5 | skip_all_without_dynamic_extension($_) foreach qw(B Fcntl); |
a5d75221 | 6 | # S_IFMT is a real subroutine, and acts as control |
1ccdb730 | 7 | # SEEK_SET is a proxy constant subroutine. |
a5d75221 | 8 | @symbols = qw(S_IFMT SEEK_SET); |
1ccdb730 NC |
9 | } |
10 | ||
11 | use strict; | |
12 | use warnings; | |
eaa79d3d | 13 | plan(4 * @symbols); |
1ccdb730 | 14 | use B qw(svref_2object GVf_IMPORTED_CV); |
a5d75221 | 15 | use Fcntl @symbols; |
1ccdb730 NC |
16 | |
17 | # GVf_IMPORTED_CV should not be set on the original, but should be set on the | |
18 | # imported GV. | |
19 | ||
20 | foreach my $symbol (@symbols) { | |
21 | my ($ps, $ms); | |
22 | { | |
23 | no strict 'refs'; | |
a5d75221 | 24 | $ps = svref_2object(\*{"Fcntl::$symbol"}); |
1ccdb730 NC |
25 | $ms = svref_2object(\*{"::$symbol"}); |
26 | } | |
bbce3ca6 | 27 | object_ok($ps, 'B::GV'); |
1ccdb730 NC |
28 | is($ps->GvFLAGS() & GVf_IMPORTED_CV, 0, |
29 | "GVf_IMPORTED_CV not set on original"); | |
bbce3ca6 | 30 | object_ok($ms, 'B::GV'); |
1ccdb730 NC |
31 | is($ms->GvFLAGS() & GVf_IMPORTED_CV, GVf_IMPORTED_CV, |
32 | "GVf_IMPORTED_CV set on imported GV"); | |
33 | } |