6 use Test::More tests => 15;
18 has '$.x' => (reader => 'x');
19 has '$.y' => (accessor => 'y');
36 after 'clear' => sub {
43 my $point = Point->new(x => 1, y => 2);
44 isa_ok($point, 'Point');
46 is($point->x, 1, '... got the right value for x');
47 is($point->y, 2, '... got the right value for y');
51 is($point->y, 10, '... got the right (changed) value for y');
55 is($point->x, 0, '... got the right (cleared) value for x');
56 is($point->y, 0, '... got the right (cleared) value for y');
58 my $point3d = Point3D->new(x => 10, y => 15, z => 3);
59 isa_ok($point3d, 'Point3D');
60 isa_ok($point3d, 'Point');
62 is($point3d->x, 10, '... got the right value for x');
63 is($point3d->y, 15, '... got the right value for y');
64 is($point3d->{'$:z'}, 3, '... got the right value for z');
68 is($point3d->x, 0, '... got the right (cleared) value for x');
69 is($point3d->y, 0, '... got the right (cleared) value for y');
70 is($point3d->{'$:z'}, 0, '... got the right (cleared) value for z');