]> git.gsnw.org Git - fping.git/commitdiff
Test that negative numbers are not accepted
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>
Tue, 6 Feb 2024 20:42:55 +0000 (21:42 +0100)
committerDavid Schweikert <david@schweikert.ch>
Wed, 7 Feb 2024 07:55:51 +0000 (08:55 +0100)
ci/test-03-forbidden.pl

index b8f216964940daf78c4ca6c26e1a7e40d2778ab9..c42c66724ca81e13ecd54f27747c874b6f6f6678 100755 (executable)
@@ -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:});
+}