Test that -x, -X, -k require numeric argument
parent
c5428391a6
commit
dcda0cc595
@ -1,10 +1,22 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
use Test::Command tests => 33;
|
use Test::Command tests => 42;
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
for my $arg (qw(b B c C H i O p Q r t)) {
|
for my $arg (qw(b B c C H i O p Q r t x X)) {
|
||||||
my $cmd = Test::Command->new(cmd => "fping -$arg xxx");
|
my $cmd = Test::Command->new(cmd => "fping -$arg xxx");
|
||||||
$cmd->exit_is_num(1);
|
$cmd->exit_is_num(1);
|
||||||
$cmd->stdout_is_eq("");
|
$cmd->stdout_is_eq("");
|
||||||
$cmd->stderr_like(qr{Usage:});
|
$cmd->stderr_like(qr{Usage:});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# fping -k, only supported on Linux, requires a number
|
||||||
|
SKIP: {
|
||||||
|
if($^O ne 'linux') {
|
||||||
|
skip '-k option is only supported on Linux', 3;
|
||||||
|
}
|
||||||
|
my $cmd = Test::Command->new(cmd => 'fping -k xxx 127.0.0.1');
|
||||||
|
$cmd->exit_is_num(1);
|
||||||
|
$cmd->stdout_is_eq("");
|
||||||
|
$cmd->stderr_like(qr{Usage:});
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue