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