From: Erik Auerswald Date: Tue, 6 Feb 2024 20:42:55 +0000 (+0100) Subject: Test that negative numbers are not accepted X-Git-Tag: v5.2~19 X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5428391a64e484e8b0aedfcb12935b49625ed20;p=fping.git Test that negative numbers are not accepted --- diff --git a/ci/test-03-forbidden.pl b/ci/test-03-forbidden.pl index b8f2169..c42c667 100755 --- a/ci/test-03-forbidden.pl +++ b/ci/test-03-forbidden.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::Command tests => 24; +use Test::Command tests => 36; # fping -i 0 my $cmd1 = Test::Command->new(cmd => "fping -i 0 -T10 -g 127.0.0.1/29"); @@ -56,3 +56,10 @@ $cmd10->exit_is_num(1); $cmd10->stdout_is_eq(""); $cmd10->stderr_is_eq("fping: backoff factor 5.1 not valid, must be between 1.0 and 5.0\n"); +# non-negative only +for my $arg (qw(i p Q t)) { + my $cmd = Test::Command->new(cmd => "fping -$arg -1"); + $cmd->exit_is_num(1); + $cmd->stdout_is_eq(""); + $cmd->stderr_like(qr{Usage:}); +}