File: 02-package-declaration.t

package info (click to toggle)
libvalidation-class-perl 7.900057-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,572 kB
  • ctags: 355
  • sloc: perl: 21,493; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 489 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
23
24
25
26
27
use Test::More tests => 4;

package MyApp::Test;

use Validation::Class;

field 'field01' => {
    required   => 1,
    min_length => 1,
    max_length => 255,
};

field 'field02' => {
    required   => 1,
    min_length => 1,
    max_length => 255,
};

package main;

my $v = MyApp::Test->new;

# check attributes
ok ref $v, 'class initialized';
ok $v->fields->{field01}, 'field01 inheritence ok';
ok $v->fields->{field02}, 'field02 inheritence ok';
ok !$v->error_count, 'no errors yet';