From c5428391a64e484e8b0aedfcb12935b49625ed20 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Tue, 6 Feb 2024 21:42:55 +0100 Subject: [PATCH] Test that negative numbers are not accepted --- ci/test-03-forbidden.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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:}); +} -- 2.43.0