Skip to content

Commit

Permalink
made tests more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 3, 2011
1 parent cae1cd2 commit 6191e3a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions t/mojo/iowatcher.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ is $writable, undef, 'handle is not writable';
# Connect
my $client =
IO::Socket::INET->new(PeerAddr => '127.0.0.1', PeerPort => $port);
$watcher->one_tick(0);
is $readable, 1, 'handle is readable';
is $writable, undef, 'handle is not writable';
$watcher->one_tick(1);
ok $readable, 'handle is readable';
ok !$writable, 'handle is not writable';

# Accept
my $server = $listen->accept;
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/iowatcher_ev.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ is $writable, undef, 'handle is not writable';
# Connect
my $client =
IO::Socket::INET->new(PeerAddr => '127.0.0.1', PeerPort => $port);
$watcher->one_tick(0);
is $readable, 1, 'handle is readable';
is $writable, undef, 'handle is not writable';
$watcher->one_tick(1);
ok $readable, 'handle is readable';
ok !$writable, 'handle is not writable';

# Accept
my $server = $listen->accept;
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/trigger.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ is_deeply \@results, [0, 0], 'right results';
$t = Mojo::IOLoop::Trigger->new;
my $done;
$t->on(done => sub { shift; $done = [@_, 'works!'] });
for my $i (0, '0.5') {
for my $i (0, 1) {
$t->begin;
Mojo::IOLoop->timer($i => sub { $t->end($i) });
}
@results = $t->start;
is_deeply $done, [0, '0.5', 'works!'], 'right results';
is_deeply \@results, [0, '0.5'], 'right results';
is_deeply $done, [0, 1, 'works!'], 'right results';
is_deeply \@results, [0, 1], 'right results';

# Mojo::IOLoop
$done = undef;
Expand Down

0 comments on commit 6191e3a

Please sign in to comment.