2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
15 has foo => (is => 'ro', default => 100);
22 for my $meth (qw(foo bar)) {
23 my $val = $foo->$meth;
24 my $b = B::svref_2object(\$val);
25 my $flags = $b->FLAGS;
26 ok($flags & B::SVf_IOK || $flags & B::SVp_IOK, "it's an int");
27 ok(!($flags & B::SVf_POK), "not a string");
35 has foo => (is => 'ro', lazy => 1, default => 100);
42 for my $meth (qw(foo bar)) {
43 my $val = $bar->$meth;
44 my $b = B::svref_2object(\$val);
45 my $flags = $b->FLAGS;
46 ok($flags & B::SVf_IOK || $flags & B::SVp_IOK, "it's an int");
47 ok(!($flags & B::SVf_POK), "not a string");
55 has foo => (is => 'ro', isa => 'Int', lazy => 1, default => 100);
62 for my $meth (qw(foo bar)) {
63 my $val = $baz->$meth;
64 my $b = B::svref_2object(\$val);
65 my $flags = $b->FLAGS;
66 ok($flags & B::SVf_IOK || $flags & B::SVp_IOK, "it's an int");
67 ok(!($flags & B::SVf_POK), "not a string");
75 has foo => (is => 'ro', default => 10.5);
82 for my $meth (qw(foo bar)) {
83 my $val = $foo2->$meth;
84 my $b = B::svref_2object(\$val);
85 my $flags = $b->FLAGS;
86 ok($flags & B::SVf_NOK || $flags & B::SVp_NOK, "it's a num");
87 ok(!($flags & B::SVf_POK), "not a string");
95 has foo => (is => 'ro', lazy => 1, default => 10.5);
101 my $bar2 = Bar2->new;
102 for my $meth (qw(foo bar)) {
103 my $val = $bar2->$meth;
104 my $b = B::svref_2object(\$val);
105 my $flags = $b->FLAGS;
106 ok($flags & B::SVf_NOK || $flags & B::SVp_NOK, "it's a num");
107 ok(!($flags & B::SVf_POK), "not a string");
115 has foo => (is => 'ro', isa => 'Num', lazy => 1, default => 10.5);
121 my $baz2 = Baz2->new;
122 for my $meth (qw(foo bar)) {
123 my $val = $baz2->$meth;
124 my $b = B::svref_2object(\$val);
125 my $flags = $b->FLAGS;
126 ok($flags & B::SVf_NOK || $flags & B::SVp_NOK, "it's a num");
127 ok(!($flags & B::SVf_POK), "not a string");