6 use Test::More tests => 15;
16 has '$.x' => (reader => 'x');
17 has '$.y' => (accessor => 'y');
34 $self->SUPER::clear();
40 my $point = Point->new(x => 1, y => 2);
41 isa_ok($point, 'Point');
43 is($point->x, 1, '... got the right value for x');
44 is($point->y, 2, '... got the right value for y');
48 is($point->y, 10, '... got the right (changed) value for y');
52 is($point->x, 0, '... got the right (cleared) value for x');
53 is($point->y, 0, '... got the right (cleared) value for y');
55 my $point3d = Point3D->new(x => 10, y => 15, z => 3);
56 isa_ok($point3d, 'Point3D');
57 isa_ok($point3d, 'Point');
59 is($point3d->x, 10, '... got the right value for x');
60 is($point3d->y, 15, '... got the right value for y');
61 is($point3d->{'$:z'}, 3, '... got the right value for z');
65 is($point3d->x, 0, '... got the right (cleared) value for x');
66 is($point3d->y, 0, '... got the right (cleared) value for y');
67 is($point3d->{'$:z'}, 0, '... got the right (cleared) value for z');