6 $ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
21 use Object::Remote::Future;
27 shift->maybe::start::_real_get_s2;
33 $C = sub { $f->done(S2F->new); undef($f); undef($C); };
50 use Object::Remote::Future;
58 $C = sub { $f->done('S3'); undef($f); undef($C); };
69 S1S->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
71 is($res, 'S3', 'Synchronous code ok');
76 S1F->start::get_s2->then::get_s3->on_ready(sub { ($res) = $_[0]->get });
78 ok(!$S2F::C, 'Second future not yet constructed');
82 ok($S2F::C, 'Second future constructed after first future completed');
84 ok(!$res, 'Nothing happened yet');
88 is($res, 'S3', 'Asynchronous code ok');
90 is(S1S->get_s2->get_s3, 'S3', 'Sync without start');
92 Object::Remote->current_loop->watch_time(
96 Object::Remote->current_loop->watch_time(
98 code => sub { $S2F::C->() }
103 is(S1F->get_s2->get_s3, 'S3', 'Async without start');