App-Fasops
view release on metacpan or search on metacpan
t/02-commands.t view on Meta::CPAN
use App::Fasops;
my $result = test_app( 'App::Fasops' => [qw(commands )] );
like(
$result->stdout,
qr{list the application's commands},
'default commands outputs'
);
is( $result->stderr, '', 'nothing sent to sderr' );
is( $result->error, undef, 'threw no exceptions' );
t/10-replace.t view on Meta::CPAN
$result = test_app( 'App::Fasops' => [qw(replace t/not_exists t/not_exists)] );
like( $result->error, qr{doesn't exist}, 'infile not exists' );
$result = test_app( 'App::Fasops' => [qw(replace t/example.fas t/replace.tsv -o stdout)] );
is( ( scalar grep {/\S/} split( /\n/, $result->stdout ) ), 32, 'line count' );
like( ( split /\n\n/, $result->stdout )[2], qr{\>S288c.+\>query}s, 'correct name order' );
$result = test_app( 'App::Fasops' => [qw(replace t/example.fas t/replace.fail.tsv -o stdout)] );
is( ( scalar grep {/\S/} split( /\n/, $result->stdout ) ), 24, 'line count' );
unlike( $result->stdout, qr{target|query}, 'not replaced' );
like( $result->stderr, qr{multiply records}, 'error message' );
$result = test_app( 'App::Fasops' => [qw(replace t/example.fas t/replace.remove.tsv -o stdout)] );
print $result->stdout;
is( ( scalar grep {/\S/} split( /\n/, $result->stdout ) ), 16, 'line count' );
unlike( $result->stdout, qr{13267\-13287}s, 'block removed' );
done_testing();
t/12-split.t view on Meta::CPAN
$result = test_app( 'App::Fasops' => [qw(split t/example.fas -o stdout)] );
is( ( scalar grep {/\S/} split( /\n/, $result->stdout ) ), 24, 'line count' );
$result = test_app( 'App::Fasops' => [qw(split t/example.fas -o stdout --simple)] );
like( $result->stdout, qr{^>S288c$}m, 'simple headers' );
unlike( $result->stdout, qr{I\(\+\)}, 'no positions' );
my Path::Tiny $tempdir = Path::Tiny::tempdir();
$result = test_app( 'App::Fasops' => [ qw(split t/example.fas --chr -o ), $tempdir->stringify ] );
is($result->stdout, "" );
is($result->stderr, "" );
ok( Path::Tiny::path( $tempdir, "I.fas" )->is_file, "file exists" );
undef $tempdir;
done_testing();
( run in 0.587 second using v1.01-cache-2.11-cpan-26ccb49234f )