File: new.t

package info (click to toggle)
libspiffy-perl 0.21-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 256 kB
  • ctags: 99
  • sloc: perl: 1,067; makefile: 50
file content (20 lines) | stat: -rw-r--r-- 329 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use lib 't';
use strict;
use warnings;
package A;
use Spiffy -base;
field 'x';
field 'y';

package main;
use Test::More tests => 6;

my $a1 = A->new;
ok(not defined $a1->x);
ok(not defined $a1->y);
my $a2 = A->new(x => 5);
is($a2->x, 5);
ok(not defined $a2->y);
my $a3 = A->new(x => 15, y => 10);
is($a3->x, 15);
is($a3->y, 10);