9e3c6b2e0253ee54b7fbb887558b6f6be8068bba
[p5sagit/Devel-Size.git] / t / pvbm.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Test::More tests => 2;
5 use Devel::Size ':all';
6 use Config;
7
8 use constant PVBM => 'galumphing';
9 my $dummy = index 'galumphing', PVBM;
10
11 if($Config{useithreads}) {
12     cmp_ok(total_size(PVBM), '>', 0, "PVBMs don't cause SEGVs");
13     # Really a core bug:
14     local $TODO = 'Under ithreads, pad constants are no longer PVBMs';
15     cmp_ok(total_size(PVBM), '>', total_size(PVBM . '') + 256,
16            "PVBMs use 256 bytes for a lookup table");
17 } else {
18     cmp_ok(total_size(PVBM), '>', total_size(PVBM . ''),
19            "PVBMs don't cause SEGVs");
20     local $TODO = 'PVBMs not yet handled properly in 5.10.0 and later'
21         if $] >= 5.010;
22     cmp_ok(total_size(PVBM), '>', total_size(PVBM . '') + 256,
23            "PVBMs use 256 bytes for a lookup table");
24 }