12 has foo => (is => 'ro', default => 100);
19 for my $meth (qw(foo bar)) {
20 my $val = $foo->$meth;
21 my $b = B::svref_2object(\$val);
22 my $flags = $b->FLAGS;
23 ok($flags & B::SVf_IOK || $flags & B::SVp_IOK, "it's an int");
24 ok(!($flags & B::SVf_POK), "not a string");
32 has foo => (is => 'ro', lazy => 1, default => 100);
39 for my $meth (qw(foo bar)) {
40 my $val = $bar->$meth;
41 my $b = B::svref_2object(\$val);
42 my $flags = $b->FLAGS;
43 ok($flags & B::SVf_IOK || $flags & B::SVp_IOK, "it's an int");
44 ok(!($flags & B::SVf_POK), "not a string");
52 has foo => (is => 'ro', isa => 'Int', lazy => 1, default => 100);
59 for my $meth (qw(foo bar)) {
60 my $val = $baz->$meth;
61 my $b = B::svref_2object(\$val);
62 my $flags = $b->FLAGS;
63 ok($flags & B::SVf_IOK || $flags & B::SVp_IOK, "it's an int");
64 ok(!($flags & B::SVf_POK), "not a string");
72 has foo => (is => 'ro', default => 10.5);
79 for my $meth (qw(foo bar)) {
80 my $val = $foo2->$meth;
81 my $b = B::svref_2object(\$val);
82 my $flags = $b->FLAGS;
83 ok($flags & B::SVf_NOK || $flags & B::SVp_NOK, "it's a num");
84 ok(!($flags & B::SVf_POK), "not a string");
92 has foo => (is => 'ro', lazy => 1, default => 10.5);
99 for my $meth (qw(foo bar)) {
100 my $val = $bar2->$meth;
101 my $b = B::svref_2object(\$val);
102 my $flags = $b->FLAGS;
103 ok($flags & B::SVf_NOK || $flags & B::SVp_NOK, "it's a num");
104 ok(!($flags & B::SVf_POK), "not a string");
112 has foo => (is => 'ro', isa => 'Num', lazy => 1, default => 10.5);
118 my $baz2 = Baz2->new;
119 for my $meth (qw(foo bar)) {
120 my $val = $baz2->$meth;
121 my $b = B::svref_2object(\$val);
122 my $flags = $b->FLAGS;
123 ok($flags & B::SVf_NOK || $flags & B::SVp_NOK, "it's a num");
124 ok(!($flags & B::SVf_POK), "not a string");