Skip tests in t/magic.t that use formline on 5.8.1 and 5.8.2
[p5sagit/Devel-Size.git] / t / code.t
index ab5d514..f2e1e26 100644 (file)
--- a/t/code.t
+++ b/t/code.t
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test::More tests => 10;
+use Test::More tests => 12;
 use Devel::Size ':all';
 
 sub zwapp;
@@ -30,13 +30,21 @@ cmp_ok(length prototype $anon_proto, '>', 0, 'prototype has a length');
 cmp_ok($anon_proto_size, '>', $anon_size + length prototype $anon_proto,
        'prototypes add to the size');
 
-{
+SKIP: {
     use vars '@b';
     my $aelemfast_lex = total_size(sub {my @a; $a[0]});
     my $aelemfast = total_size(sub {my @a; $b[0]});
 
+    # This one is sane even before Dave's lexical aelemfast changes:
     cmp_ok($aelemfast_lex, '>', $anon_size,
           'aelemfast for a lexical is handled correctly');
+    skip('alemfast was extended to lexicals after this perl was released', 1)
+      if $] < 5.008004;
     cmp_ok($aelemfast, '>', $aelemfast_lex,
           'aelemfast for a package variable is larger');
 }
+
+my $short_pvop = total_size(sub {goto GLIT});
+my $long_pvop = total_size(sub {goto KREEK_KREEK_CLANK_CLANK});
+cmp_ok($short_pvop, '>', $anon_size, 'OPc_PVOP can be measured');
+is($long_pvop, $short_pvop + 19, 'the only size difference is the label length');