File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 11# !/usr/bin/perl -w
22
3- use Test::Command tests => 15 ;
3+ use Test::Command tests => 21 ;
44use Test::More;
55
66# ping 127.0.0.1
5353 $cmd -> stdout_is_eq(" " );
5454 $cmd -> stderr_like(qr { host\. name\. invalid: .+\n } );
5555}
56+
57+ # Mixed arguments to exercise optparse permutation
58+ {
59+ my $cmd = Test::Command-> new(cmd => " fping 127.0.0.1 -c 1" );
60+ $cmd -> exit_is_num(0);
61+ $cmd -> stdout_like(qr { 127\. 0\. 0\. 1 : \[ 0\] , 64 bytes} );
62+ $cmd -> stderr_like(qr {\s *127\. 0\. 0\. 1\s +:\s xmt/rcv/%loss = 1/1/0%, min/avg/max} );
63+ }
64+
65+ # fping6 symlink compatibility
66+ SKIP: {
67+ if ($ENV {SKIP_IPV6 }) {
68+ skip ' Skip IPv6 tests' , 3;
69+ }
70+
71+ symlink " fping" , " src/fping6" or die " Failed to create symlink: $! " ;
72+
73+ my $cmd = Test::Command-> new(cmd => " ./src/fping6 ::1 -c 1" );
74+ $cmd -> exit_is_num(0);
75+ $cmd -> stdout_like(qr { ::1 : \[ 0\] , 64 bytes} );
76+ $cmd -> stderr_like(qr { ^\s *::1 : xmt/rcv/%loss = 1/1/0%, min/avg/max = .*$} );
77+
78+ unlink " src/fping6" ;
79+ }
You can’t perform that action at this time.
0 commit comments