Commit | Line | Data |
b63a955f |
1 | use strictures 1; |
2 | use Test::More; |
c6fe6fbd |
3 | use Sys::Hostname qw(hostname); |
b63a955f |
4 | |
b63a955f |
5 | use Object::Remote; |
6 | |
7 | $ENV{PERL5LIB} = join( |
8 | ':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib t/lib) |
9 | ); |
10 | |
4c17fea5 |
11 | my $connection = Object::Remote->connect('-'); |
b63a955f |
12 | |
13 | #$Object::Remote::Connection::DEBUG = 1; |
14 | |
4c17fea5 |
15 | my $remote = ORTestClass->new::on($connection); |
b63a955f |
16 | |
676438a1 |
17 | isnt($$, $remote->pid, 'Different pid on the other side'); |
b63a955f |
18 | |
676438a1 |
19 | is($remote->counter, 0, 'Counter at 0'); |
b63a955f |
20 | |
676438a1 |
21 | is($remote->increment, 1, 'Increment to 1'); |
b63a955f |
22 | |
676438a1 |
23 | is($remote->counter, 1, 'Counter at 1'); |
b63a955f |
24 | |
fe6c9a7f |
25 | my $x = 0; |
26 | |
27 | is($remote->call_callback(27, sub { $x++ }), 27, "Callback ok"); |
28 | |
29 | is($x, 1, "Callback called callback"); |
30 | |
c6fe6fbd |
31 | is( |
624b459b |
32 | Sys::Hostname->can::on($connection, 'hostname')->(), |
c6fe6fbd |
33 | hostname(), |
34 | 'Remote sub call ok' |
35 | ); |
36 | |
b63a955f |
37 | done_testing; |