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