Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test error for running a directory.
Plus tweak another test to expect the error on STDERR, not STDOUT.
  • Loading branch information
jnthn committed Jul 15, 2015
1 parent f21cb19 commit 9f936e7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions S19-command-line/arguments.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 2;
plan 3;

use lib 't/spec/packages';
use Test::Util;
Expand All @@ -17,8 +17,8 @@ use Test::Util;
else {
is_run( $x, :args[$file],
{
out => { .chars < 256 && m/"Could not open $file"/ },
err => "",
out => '',
err => { .chars < 256 && m/"Could not open $file"/ },
},
'concise error message when called script not found' );
}
Expand All @@ -32,3 +32,17 @@ use Test::Util;

is shell($cmd).exitcode, 42, "'-' as argument means STDIN";
}

# RT #125600
{
my $dir = 'omg-a-directory';
mkdir $dir;
LEAVE rmdir 'omg-a-directory';
my Str $x;
is_run( $x, :args[$dir],
{
out => '',
err => { .chars < 256 && m/$dir/ && m/directory/ },
},
'concise error message when called script is a directory' );
}

0 comments on commit 9f936e7

Please sign in to comment.