X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fmagic.t;h=3fa7d05d6b201cfcd1a9c5f69996725851f9265d;hb=98b91a13eb79864172fa4bf6a7eb84ed0ab7d468;hp=8dfb6dea81b2cf39cb771b12fcc3c95fc8b13fae;hpb=d1888d0bf6f3c739044dc19ebd3114e3dc13bb47;p=p5sagit%2FDevel-Size.git diff --git a/t/magic.t b/t/magic.t index 8dfb6de..3fa7d05 100644 --- a/t/magic.t +++ b/t/magic.t @@ -15,7 +15,12 @@ require Tie::Scalar; 'size increases due to magic'); } -{ +SKIP: { + # bug in perl added in blead by commit 815f25c6e302f84e, fixed in commit + # f5c235e79ea25787, merged to maint-5.8 as 0710cc63c26afd0c and + # 8298b2e171ce84cf respectively. + skip("This triggers a formline assertion on $]", 4) + if $] > 5.008000 && $] < 5.008003; my $string = 'Perl Rules'; my $before_size = total_size($string); formline $string; @@ -41,13 +46,14 @@ require Tie::Scalar; my $after_size = total_size($string); cmp_ok($after_size, '>', $before_size, 'size increases due to magic'); is($string, undef, 'No value yet'); + my $small_size = total_size($string); # This is defineately cheating, in that we're poking inside the # implementation of Tie::StdScalar, but if we just write to $string, the way # magic works, the (nice long) value is first written to the regular scalar, # then picked up by the magic. So it grows, which defeats the purpose of the # test. ${tied $string} = 'X' x 1024; - cmp_ok(total_size($string), '>', $after_size + 1024, + cmp_ok(total_size($string), '>', $small_size + 1024, 'the magic object is counted'); }