diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-06-26 02:16:57 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-06-26 02:45:05 -0500 |
commit | 82f96200b9278a0f0e740cbfabe02ec1d10d0f4a (patch) | |
tree | a40b9cff91c0f4e371b83a206a8b6dd5dc4e52b4 /t/run | |
parent | 07b2a6c81736d9de93adea8c82dbe3d2d43c8a13 (diff) | |
download | perl-82f96200b9278a0f0e740cbfabe02ec1d10d0f4a.tar.gz |
warn on -i with no input files given [perl #113410]
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/switches.t | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/t/run/switches.t b/t/run/switches.t index 57ae32474d..5c3b5ee406 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -11,7 +11,7 @@ BEGIN { BEGIN { require "./test.pl"; } -plan(tests => 112); +plan(tests => 114); use Config; @@ -350,6 +350,26 @@ __EOF__ is(join(":", @bak), "foo yada dada:bada foo bing:king kong foo", "-i backup file"); + + my $out1 = runperl( + switches => ['-i.bak -p'], + prog => 'exit', + stderr => 1, + stdin => "1\n", + ); + is( + $out1, + "-i used with no filenames on the command line, reading from STDIN.\n", + "warning when no files given" + ); + my $out2 = runperl( + switches => ['-i.bak -p'], + prog => 'exit', + stderr => 1, + stdin => "1\n", + args => ['file'], + ); + is($out2, "", "no warning when files given"); } # Tests for -E |