Skip to content

Commit

Permalink
Fix test in rev that looks from program name
Browse files Browse the repository at this point in the history
  • Loading branch information
briandfoy committed Nov 9, 2023
1 parent 84e6c4f commit e106509
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions t/rev/rev.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ END { done_testing() }
use lib qw(t/lib);
use utils;

use File::Basename;
use File::Spec::Functions;
use IPC::Run3 qw(run3);

my $command = 'bin/rev';
my $basename = basename($command);

subtest script => sub {
ok( -e $command, "$command exists" );
Expand Down Expand Up @@ -50,7 +52,7 @@ subtest "version" => sub {
my @command = ( $^X, $command, '--version' );
run3 \@command, undef, \$output, \$error;

like $output, qr/\Q$command\E \d+\.\d+/, "shows version message";
like $output, qr/\Q$basename\E \d+\.\d+/, "shows version message";
};

subtest "help" => sub {
Expand All @@ -59,6 +61,6 @@ subtest "help" => sub {
my( $output, $error );
my @command = ( $^X, $command, $arg );
run3 \@command, undef, \$output, \$error;
like $output, qr/Usage: \Q$command/, "shows help message";
like $output, qr/Usage: \Q$basename/, "shows help message";
}
};

0 comments on commit e106509

Please sign in to comment.