From f53c124b9e34d38f7dc44d7c60374bcc4f622e22 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Tue, 29 Mar 2022 17:33:31 +0200 Subject: [PATCH] Add explicit test for `set_pipe_sz()` to ensure stable test coverage See https://progress.opensuse.org/issues/105759 --- t/10-virtio_terminal.t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t/10-virtio_terminal.t b/t/10-virtio_terminal.t index 2350fb714b0..f284bc41eca 100755 --- a/t/10-virtio_terminal.t +++ b/t/10-virtio_terminal.t @@ -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');