8 my $obj = $class->new(less_than_three => 1);
10 is($obj->less_than_three, 1, "initial value set (${class})");
13 exception { $obj->less_than_three(4) },
14 qr/4 is not less than three/, "exception thrown on bad set (${class})"
17 is($obj->less_than_three, 1, "initial value remains after bad set (${class})");
22 exception { $ret = $obj->less_than_three(2) },
23 undef, "no exception on correct set (${class})"
26 is($ret, 2, "correct setter return (${class})");
27 is($obj->less_than_three, 2, "correct getter return (${class})");
29 is(exception { $class->new }, undef, "no exception with no value (${class})");
31 exception { $class->new(less_than_three => 12) },
32 qr/12 is not less than three/,
33 "exception thrown on bad constructor arg (${class})"
42 has less_than_three => (
44 isa => sub { die "$_[0] is not less than three" unless $_[0] < 3 }
56 has less_than_three => (
60 die "$x is not less than three" unless $x < 3
73 has less_than_three => (
78 die "$value is not less than ${word}" unless $value < $limit
80 { '$limit' => \3, '$word' => \'three' }