Skip to content

Commit

Permalink
Merge pull request #2008 from Martchus/coverage
Browse files Browse the repository at this point in the history
Add explicit test for `set_pipe_sz()` to ensure stable test coverage
  • Loading branch information
mergify[bot] committed Mar 29, 2022
2 parents 4399070 + f53c124 commit d1e87f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/10-virtio_terminal.t
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 d1e87f2

Please sign in to comment.