From 15f05dd8946ecbab70bdd05c54906ef4914f0a8a Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Wed, 24 Dec 2025 08:06:32 +0100 Subject: [PATCH] Small code coverage improvements --- ci/test-01-basics.pl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/ci/test-01-basics.pl b/ci/test-01-basics.pl index e54bc22..3341950 100755 --- a/ci/test-01-basics.pl +++ b/ci/test-01-basics.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::Command tests => 15; +use Test::Command tests => 21; use Test::More; # ping 127.0.0.1 @@ -53,3 +53,27 @@ SKIP: { $cmd->stdout_is_eq(""); $cmd->stderr_like(qr{host\.name\.invalid: .+\n}); } + +# Mixed arguments to exercise optparse permutation +{ + my $cmd = Test::Command->new(cmd => "fping 127.0.0.1 -c 1"); + $cmd->exit_is_num(0); + $cmd->stdout_like(qr{127\.0\.0\.1 : \[0\], 64 bytes}); + $cmd->stderr_like(qr{\s*127\.0\.0\.1\s+:\sxmt/rcv/%loss = 1/1/0%, min/avg/max}); +} + +# fping6 symlink compatibility +SKIP: { + if($ENV{SKIP_IPV6}) { + skip 'Skip IPv6 tests', 3; + } + + symlink "fping", "src/fping6" or die "Failed to create symlink: $!"; + + my $cmd = Test::Command->new(cmd => "./src/fping6 ::1 -c 1"); + $cmd->exit_is_num(0); + $cmd->stdout_like(qr{::1 : \[0\], 64 bytes}); + $cmd->stderr_like(qr{^\s*::1 : xmt/rcv/%loss = 1/1/0%, min/avg/max = .*$}); + + unlink "src/fping6"; +} -- 2.43.0