Skip to content

Commit

Permalink
Add explicit test for set_pipe_sz() to ensure stable test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Mar 29, 2022
1 parent 4399070 commit f53c124
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/10-virtio_terminal.t
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ sub cleanup_pipes ($obj) {
unlink for (@{$obj->{files}});
}

subtest 'set_pipe_sz() error handling (ensuring stable test coverage of that function)' => sub {
my $term = consoles::virtio_terminal->new('unit-test-console', {});
like(warning { ok !$term->set_pipe_sz(0, 42), 'error returned' }, qr/fcntl\(\) on unopened filehandle 0/, 'fcntl invoked');
};

subtest "Test open_pipe() error condition" => sub {
my $socket_path = './virtio_console_open_test';
my $file_mock = Test::MockModule->new('Mojo::File');
Expand Down

0 comments on commit f53c124

Please sign in to comment.