| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
|
| 4 |
use Test::More; |
| 5 |
|
| 6 |
use Capture::Tiny qw( capture ); |
| 7 |
use Encode qw( decode ); |
| 8 |
use FindBin qw( $Bin ); |
| 9 |
|
| 10 |
binmode $_, ':encoding(utf-8)' |
| 11 |
for map { Test::More->builder->$_ } |
| 12 |
qw( output failure_output todo_output ); |
| 13 |
|
| 14 |
chdir "$Bin/../.." |
| 15 |
or die "Cannot chdir to $Bin/../..: $!"; |
| 16 |
|
| 17 |
my ( $out, $err ) = capture { system(qw( precious lint -a )) }; |
| 18 |
$_ = decode( 'UTF-8', $_ ) for grep {defined} $out, $err; |
| 19 |
|
| 20 |
is( $? >> 8, 0, 'precious lint -a exited with 0' ) |
| 21 |
or diag($out); |
| 22 |
is( $err, q{}, 'no output to stderr' ); |
| 23 |
|
| 24 |
done_testing(); |