wrap_badarg.t (553B)
1 # 2 # Make sure calling citrun_wrap with arguments fails. 3 # 4 use Modern::Perl; 5 use Test::Cmd; 6 use Test::More tests => 3; 7 8 9 my $wrap = Test::Cmd->new( prog => 'bin/citrun_wrap', workdir => '' ); 10 11 my $e; 12 if ($^O eq "MSWin32") { 13 $e = "'-ASD' is not recognized as an internal or external command"; 14 } else { 15 $e = '-ASD: not found'; 16 } 17 18 $wrap->run( args => '-ASD', chdir => $wrap->curdir ); 19 is( $wrap->stdout, '', 'citrun_wrap stdout silent' ); 20 like( $wrap->stderr, qr/$e/, 'citrun_wrap stderr an error' ); 21 isnt( $? >> 8, 0, 'citrun_wrap exit code nonzero' );