]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/lei-import: relax EIO regexp
authorEric Wong <e@80x24.org>
Wed, 13 Dec 2023 00:50:19 +0000 (00:50 +0000)
committerEric Wong <e@80x24.org>
Wed, 13 Dec 2023 09:01:55 +0000 (09:01 +0000)
musl uses "I/O error" while glibc uses "Input/output error"
I wish something like strerrorname_np(3) were portable
and built into Perl so we could just match on /EIO/.

t/lei-import.t

index b4446b566a0cd72a684352e8e62cf757e4184f29..89eb149261162dde66c3574366d58590a9f26cee 100644 (file)
@@ -172,12 +172,13 @@ SKIP: {
        tick; # wait for strace to attach
        ok(!lei(qw(import -F eml t/plack-qp.eml)),
                '-F eml import fails on pathname error injection');
-       like($lei_err, qr!error reading t/plack-qp\.eml: .*Input/output error!,
+       my $IO = '[Ii](?:nput)?/[Oo](?:utput)?';
+       like($lei_err, qr!error reading t/plack-qp\.eml: .*?$IO error!,
                'EIO noted in stderr');
        open $fh, '<', 't/plack-qp.eml';
        ok(!lei(qw(import -F eml -), undef, { %$lei_opt, 0 => $fh }),
                '-F eml import fails on stdin error injection');
-       like($lei_err, qr!error reading .*?: .*Input/output error!,
+       like($lei_err, qr!error reading .*?: .*?$IO error!,
                'EIO noted in stderr');
 }