File: basic.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 (39 lines) | stat: -rw-r--r-- 775 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use strictures 1;
use Test::More;
use Sys::Hostname qw(hostname);

$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;

use Object::Remote;

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

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

#$Object::Remote::Connection::DEBUG = 1;

my $remote = ORTestClass->new::on($connection);

isnt($$, $remote->pid, 'Different pid on the other side');

is($remote->counter, 0, 'Counter at 0');

is($remote->increment, 1, 'Increment to 1');

is($remote->counter, 1, 'Counter at 1');

my $x = 0;

is($remote->call_callback(27, sub { $x++ }), 27, "Callback ok");

is($x, 1, "Callback called callback");

is(
  Sys::Hostname->can::on($connection, 'hostname')->(),
  hostname(),
  'Remote sub call ok'
);

done_testing;