File: field2.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 (22 lines) | stat: -rw-r--r-- 421 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
21
22
use lib 't', 'lib';
use strict;
use warnings;

package Foo;
use Spiffy -base;
field one => [];
field two => {};
field three => [1..4];
field four => {1..4};

package main;
use Test::More tests => 5;
use Spiffy 'id';

my $f1 = Foo->new;
my $f2 = Foo->new;
ok(id($f1->one) ne id($f2->one));
ok(id($f1->two) ne id($f2->two));
is(scalar(@{$f1->three}), 4);
is_deeply($f1->three, $f2->three);
is_deeply($f1->four, $f2->four);