File: objects.t

package info (click to toggle)
libobject-remote-perl 0.004000-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • ctags: 248
  • sloc: perl: 2,408; makefile: 7
file content (24 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strictures 1;
use Test::More;
use Sys::Hostname qw(hostname);
use overload ();

use Object::Remote;

$ENV{PERL5LIB} = join(
  ':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib t/lib)
);

my $connection = Object::Remote->connect('-');

my $ortestobj_j = ORTestObjects->new::on($connection, { name => 'John' });
my $ortestobj_k = ORTestObjects->new::on($connection, { name => 'Ken' });

is($ortestobj_k->takes_object($ortestobj_j), 1, 'Passed correct object back over the wire');

my $george = ORTestObjects->new::on($connection, { name => 'George'});
my $george_again = $george->give_back;
is($george->{remote}, $george_again->{remote}, 'objects appear to be the same');
is($george->name, $george_again->name, 'objects have the same name');

done_testing;