summaryrefslogtreecommitdiff
path: root/t/02scope.t
blob: f2acb1e23840e5195b28b8b818a9c02de98f0dd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;

package Foo;
use Struct::Dumb;
struct Point => [qw( x y )];

package Bar;
use Struct::Dumb;
struct Point => [qw( x y z )];

package main;

my $point2 = Foo::Point(10, 20);
my $point3 = Bar::Point(10, 20, 30);

ok( !$point2->can( "z" ), '$point2 cannot ->z' );
can_ok( $point3, "z" );

done_testing;