Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (27 sloc) 951 Bytes
use strict;
use warnings;
BEGIN { $ENV{PERL_RL} = 'Stub'; }
use Test::More;
use Term::ReadLine 1.09;
use Term::ReadLine::Event;
BEGIN { plan skip_all => "POE is not installed" unless eval "use POE; 1"; }
plan tests => 2;
# silence warning.
POE::Kernel->run();
my $term = Term::ReadLine::Event->with_POE('test');
isa_ok($term->trl, 'Term::ReadLine::Stub');
POE::Session->create(
inline_states => {
_start => sub {
$_[KERNEL]->delay(tick => 0.1);
$_[KERNEL]->alias_set('ticker');
},
tick => sub {
pass;
print {$term->trl()->OUT()} $Term::ReadLine::Stub::rl_term_set[3];
exit 0
},
},
);
$term->readline('> Do not type anything');
fail();
Jump to Line
Something went wrong with that request. Please try again.