File: 99-objects-not-sharing-params.t

package info (click to toggle)
libvalidation-class-perl 7.900058-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,536 kB
  • sloc: perl: 21,493; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl

use utf8;
use strict;
use warnings;
use Test::More;

plan skip_all => 'TODO: Fix bug' if ! $ENV{'DEVELOPMENT_TESTS'};

package MyApp::Person;

use Validation::Class;

field 'name';

package main;

my $person1 = MyApp::Person->new(params => { name => 'foo' });
my $person2 = MyApp::Person->new(params => { name => 'bar' });

diag $person1->params->get('name');
diag $person2->params->get('name');

ok $person1->name ne $person2->name, 'parameter values are different';

done_testing();