#!/usr/bin/perl -w use Test::Command tests => 9; my $I_HELP = " -I if bind to a particular interface\n"; $I_HELP = '' if $^O eq 'darwin'; # fping -h my $cmd1 = Test::Command->new(cmd => "fping -h"); $cmd1->exit_is_num(0); $cmd1->stdout_is_eq(<stderr_is_eq(""); # fping -v my $cmd2 = Test::Command->new(cmd => "fping -v"); $cmd2->exit_is_num(0); $cmd2->stdout_like(qr{fping: Version \S+ fping: comments to david\@schweikert\.ch\n}); $cmd2->stderr_is_eq(""); # fping with unknown option my $cmd3 = Test::Command->new(cmd => "fping -Z"); $cmd3->exit_is_num(1); $cmd3->stdout_is_eq(""); if($^O eq 'darwin') { $cmd3->stderr_is_eq("fping: illegal option -- Z\nsee 'fping -h' for usage information\n"); } else { $cmd3->stderr_is_eq("fping: invalid option -- 'Z'\nsee 'fping -h' for usage information\n"); }