File: 02scope.t

package info (click to toggle)
libstruct-dumb-perl 0.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 160 kB
  • sloc: perl: 468; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 358 bytes parent folder | download
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 v5.14;
use warnings;

use Test2::V0;

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;