From: David Schweikert Date: Mon, 13 Feb 2017 20:47:10 +0000 (+0100) Subject: improve test coverage X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4fe99d8cc897a5908b2b9e6e8bbd5617da51cbb;p=fping.git improve test coverage --- diff --git a/ci/test-04-options-a-b.pl b/ci/test-04-options-a-b.pl index 7958a3c..83859ae 100755 --- a/ci/test-04-options-a-b.pl +++ b/ci/test-04-options-a-b.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::Command tests => 29; +use Test::Command tests => 32; use Test::More; use Time::HiRes qw(gettimeofday tv_interval); @@ -19,6 +19,14 @@ $cmd->stdout_is_eq(""); $cmd->stderr_is_eq("fping: can't specify both -4 and -6\n"); } +# fping -6 -4 +{ +my $cmd = Test::Command->new(cmd => "fping -6 -4 127.0.0.1"); +$cmd->exit_is_num(1); +$cmd->stdout_is_eq(""); +$cmd->stderr_is_eq("fping: can't specify both -4 and -6\n"); +} + # fping -4 { my $cmd = Test::Command->new(cmd => "fping -4 127.0.0.1"); diff --git a/ci/test-14-ping-internet-hosts.pl b/ci/test-14-ping-internet-hosts.pl index f2b63ed..53c2e11 100755 --- a/ci/test-14-ping-internet-hosts.pl +++ b/ci/test-14-ping-internet-hosts.pl @@ -79,6 +79,14 @@ SKIP: { $cmd->stderr_is_eq(""); } +# fping -m -A +{ +my $cmd = Test::Command->new(cmd => "fping -4 -A -m www.github.com"); +$cmd->exit_is_num(0); +$cmd->stdout_like(qr{\d+\.\d+\.\d+\.\d+\n is alive\n\d+\.\d+\.\d+\.\d+ is alive\n}); +$cmd->stderr_is_eq(""); +} + # fping -n { my $cmd = Test::Command->new(cmd => "fping -n 8.8.8.8");