Skip to content

Commit

Permalink
t: fix read mock in t/27-consoles-vnc.t
Browse files Browse the repository at this point in the history
read is supposed to return number of bytes, not just true/false.
  • Loading branch information
marmarek committed Jan 10, 2024
1 parent 6c67d2f commit 21ac3a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion t/27-consoles-vnc.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ my $inet_mock = Test::MockModule->new('IO::Socket::INET');
my $s = Test::MockObject->new->set_true(qw(sockopt fileno print connected close blocking));
sub _setup_rfb_magic () { $s->set_series('mocked_read', 'RFB 003.006', pack('N', 1)) }
_setup_rfb_magic;
$s->mock(read => sub { $_[1] = $s->mocked_read; defined $_[1] });
$s->mock(read => sub { $_[1] = $s->mocked_read; length $_[1] });
$s->mock($_ => sub { push @printed, $_[1] }) for qw(print write);
$inet_mock->redefine(new => $s);
$vnc_mock->noop('_server_initialization');
Expand Down

0 comments on commit 21ac3a9

Please sign in to comment.