From: David Schweikert Date: Wed, 24 Dec 2025 07:06:32 +0000 (+0100) Subject: Small code coverage improvements X-Git-Tag: v5.5~7 X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15f05dd8946ecbab70bdd05c54906ef4914f0a8a;p=fping.git Small code coverage improvements --- 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"; +}