Skip to content

Commit

Permalink
test reset with active watchers
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 6, 2014
1 parent 6eab5ff commit cedeab3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions t/mojo/reactor_ev.t
Expand Up @@ -150,6 +150,13 @@ ok !$recurring, 'recurring was not triggered again';
my $reactor2 = Mojo::Reactor::EV->new;
is ref $reactor2, 'Mojo::Reactor::Poll', 'right object';

# Reset while watchers are active
$writable = undef;
$reactor->io($_ => sub { ++$writable and shift->reset })->watch($_, 0, 1)
for $client, $server;
$reactor->start;
is $writable, 1, 'only one handle was writable';

# Concurrent reactors
$timer = 0;
$reactor->recurring(0 => sub { $timer++ });
Expand Down
7 changes: 7 additions & 0 deletions t/mojo/reactor_poll.t
Expand Up @@ -148,6 +148,13 @@ ok !$recurring, 'recurring was not triggered again';
my $reactor2 = Mojo::Reactor::Poll->new;
is ref $reactor2, 'Mojo::Reactor::Poll', 'right object';

# Reset while watchers are active
$writable = undef;
$reactor->io($_ => sub { ++$writable and shift->reset })->watch($_, 0, 1)
for $client, $server;
$reactor->start;
is $writable, 1, 'only one handle was writable';

# Concurrent reactors
$timer = 0;
$reactor->recurring(0 => sub { $timer++ });
Expand Down

0 comments on commit cedeab3

Please sign in to comment.