Skip to content

Commit 15f05dd

Browse files
committed
Small code coverage improvements
1 parent d8f9161 commit 15f05dd

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

ci/test-01-basics.pl

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/perl -w
22

3-
use Test::Command tests => 15;
3+
use Test::Command tests => 21;
44
use Test::More;
55

66
# ping 127.0.0.1
@@ -53,3 +53,27 @@
5353
$cmd->stdout_is_eq("");
5454
$cmd->stderr_like(qr{host\.name\.invalid: .+\n});
5555
}
56+
57+
# Mixed arguments to exercise optparse permutation
58+
{
59+
my $cmd = Test::Command->new(cmd => "fping 127.0.0.1 -c 1");
60+
$cmd->exit_is_num(0);
61+
$cmd->stdout_like(qr{127\.0\.0\.1 : \[0\], 64 bytes});
62+
$cmd->stderr_like(qr{\s*127\.0\.0\.1\s+:\sxmt/rcv/%loss = 1/1/0%, min/avg/max});
63+
}
64+
65+
# fping6 symlink compatibility
66+
SKIP: {
67+
if($ENV{SKIP_IPV6}) {
68+
skip 'Skip IPv6 tests', 3;
69+
}
70+
71+
symlink "fping", "src/fping6" or die "Failed to create symlink: $!";
72+
73+
my $cmd = Test::Command->new(cmd => "./src/fping6 ::1 -c 1");
74+
$cmd->exit_is_num(0);
75+
$cmd->stdout_like(qr{::1 : \[0\], 64 bytes});
76+
$cmd->stderr_like(qr{^\s*::1 : xmt/rcv/%loss = 1/1/0%, min/avg/max = .*$});
77+
78+
unlink "src/fping6";
79+
}

0 commit comments

Comments
 (0)