X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fglobs.t;h=ae32309745016780240e98f3a23963208d7d41a1;hb=638a265a89c75e2418ddc1c87a560bb8022ea667;hp=d37826a22e1100eba2e3646019e9cf6457c1e9b6;hpb=ce5e7c21ee5eb5beb9c08dcc9621abeca548778b;p=p5sagit%2FDevel-Size.git diff --git a/t/globs.t b/t/globs.t index d37826a..ae32309 100644 --- a/t/globs.t +++ b/t/globs.t @@ -60,9 +60,18 @@ $SIG{__WARN__} = sub { my $copy = *PFLAP; my $copy_gv_size = total_size($copy); # GV copies point back to the real GV through GvEGV. They share the same GP - # and GvFILE - is($copy_gv_size, $real_gv_size + $incremental_gv_size - $gp_size, - 'GV copies point back to the real GV'); + # and GvFILE. In 5.10 and later GvNAME is also shared. + my $shared_gvname = 0; + if ($] >= 5.010) { + # Calculate the size of the shared HEK: + my %h = (PFLAP => 0); + my $shared = (keys %h)[0]; + $shared_gvname = total_size($shared); + undef $shared; + $shared_gvname-= total_size($shared); + } + is($copy_gv_size, $real_gv_size + $incremental_gv_size - $gp_size + - $shared_gvname, 'GV copies point back to the real GV'); } sub gv_grew { @@ -135,7 +144,8 @@ sub gv_grew { gv_grew('glipp', 'zok', 'no strict "vars"; $zok = undef; 1', 'SCALAR'); gv_grew('bang', 'boff', 'no strict "vars"; @boff = (); 1', 'ARRAY'); gv_grew('clange', 'sock', 'no strict "vars"; %sock = (); 1', 'HASH'); -{ +SKIP: { + skip("Can't create FORMAT references prior to 5.8.0", 7) if $] < 5.008; local $Devel::Size::warn = 0; gv_grew('biff', 'zapeth', "format zapeth =\n.\n1", 'FORMAT'); }