6 use Test::More tests => 15;
16 has '$.x' => (reader => 'x');
17 has '$.y' => (accessor => 'y');
32 after 'clear' => sub {
39 my $point = Point->new(x => 1, y => 2);
40 isa_ok($point, 'Point');
42 is($point->x, 1, '... got the right value for x');
43 is($point->y, 2, '... got the right value for y');
47 is($point->y, 10, '... got the right (changed) value for y');
51 is($point->x, 0, '... got the right (cleared) value for x');
52 is($point->y, 0, '... got the right (cleared) value for y');
54 my $point3d = Point3D->new(x => 10, y => 15, z => 3);
55 isa_ok($point3d, 'Point3D');
56 isa_ok($point3d, 'Point');
58 is($point3d->x, 10, '... got the right value for x');
59 is($point3d->y, 15, '... got the right value for y');
60 is($point3d->{'$:z'}, 3, '... got the right value for z');
64 is($point3d->x, 0, '... got the right (cleared) value for x');
65 is($point3d->y, 0, '... got the right (cleared) value for y');
66 is($point3d->{'$:z'}, 0, '... got the right (cleared) value for z');