App-Dazz

 view release on metacpan or  search on metacpan

t/01-commands.t  view on Meta::CPAN

use App::Dazz;

my $result = test_app( 'App::Dazz' => [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' );

done_testing(3);

t/07-overlap.t  view on Meta::CPAN


SKIP: {
    skip "dazz and its deps not installed", 7
        unless IPC::Cmd::can_run('dazz')
            or IPC::Cmd::can_run('faops')
            or IPC::Cmd::can_run('fasta2DB')
            or IPC::Cmd::can_run('LAshow')
            or IPC::Cmd::can_run('ovlpr');

    $result = test_app('App::Dazz' => [ qw(overlap t/1_4.pac.fasta -v -o stdout) ]);
    is((scalar grep {/^CMD/} grep {/\S/} split(/\n/, $result->stderr)), 5, 'stderr line count');
    is((scalar grep {/\S/} split(/\n/, $result->stdout)), 18, 'line count');
    like($result->stdout, qr{overlap}s, 'overlaps');
    like($result->stdout, qr{pac4745_7148}s, 'original names');

    $result = test_app('App::Dazz' => [ qw(overlap t/1_4.pac.fasta --idt 0.8 --len 2500 --serial -o stdout) ]);
    is((scalar grep {/\S/} split(/\n/, $result->stdout)), 4, 'line count');
    unlike($result->stdout, qr{pac4745_7148}s, 'serials');

    $result = test_app('App::Dazz' => [ qw(overlap t/1_4.pac.fasta --idt 0.8 --len 2500 --all -o stdout) ]);
    is((scalar grep {/\S/} split(/\n/, $result->stdout)), 42, 'line count');

t/09-orient.t  view on Meta::CPAN

SKIP: {
    skip "dazz and its deps not installed", 3
        unless IPC::Cmd::can_run('dazz')
            or IPC::Cmd::can_run('faops')
            or IPC::Cmd::can_run('fasta2DB')
            or IPC::Cmd::can_run('LAshow')
            or IPC::Cmd::can_run('ovlpr');

    $result = test_app('App::Dazz' =>
        [ qw(orient t/1_4.anchor.fasta t/1_4.pac.fasta -r t/1_4.2.restrict.tsv -v -o stdout) ]);
    is((scalar grep {/^CMD/} grep {/\S/} split(/\n/, $result->stderr)), 9, 'stderr line count');
    is((scalar grep {/\S/} split(/\n/, $result->stdout)), 24, 'line count');
    like($result->stdout, qr{pac4745_7148}s, 'original names');
}

done_testing();

t/14-contained.t  view on Meta::CPAN


SKIP: {
    skip "dazz and its deps not installed", 7
        unless IPC::Cmd::can_run('dazz')
            or IPC::Cmd::can_run('faops')
            or IPC::Cmd::can_run('fasta2DB')
            or IPC::Cmd::can_run('LAshow')
            or IPC::Cmd::can_run('ovlpr');

    $result = test_app('App::Dazz' => [ qw(contained t/1_4.anchor.fasta --prefix anchor -v -o stdout) ]);
    is((scalar grep {/^CMD/} grep {/\S/} split(/\n/, $result->stderr)), 3, 'stderr line count');
    is((scalar grep {/\S/} split(/\n/, $result->stdout)), 8, 'line count');
    unlike($result->stdout, qr{anchor576_1624}s, 'original names');
    like($result->stdout, qr{anchor_0\/1\/}s, 'renamed');

    $result = test_app('App::Dazz' => [ qw(contained t/contained.fasta -v -o stdout) ]);
    is((scalar grep {/^CMD/} grep {/\S/} split(/\n/, $result->stderr)), 3, 'stderr line count');
    is((scalar grep {/\S/} split(/\n/, $result->stdout)), 2, 'line count');
    like($result->stdout, qr{infile_0\/}s, 'renamed');
}

done_testing();

t/15-merge.t  view on Meta::CPAN


SKIP: {
    skip "dazz and its deps not installed", 3
        unless IPC::Cmd::can_run('dazz')
            or IPC::Cmd::can_run('faops')
            or IPC::Cmd::can_run('fasta2DB')
            or IPC::Cmd::can_run('LAshow')
            or IPC::Cmd::can_run('ovlpr');

    $result = test_app('App::Dazz' => [ qw(merge t/merge.fasta -v -o stdout) ]);
    is((scalar grep {/^CMD/} grep {/\S/} split(/\n/, $result->stderr)), 3, 'stderr line count');
    is((scalar grep {/\S/} split(/\n/, $result->stdout)), 2, 'line count');
    like($result->stdout, qr{merge_1}s, 'merged');
}

done_testing();

t/16-layout.t  view on Meta::CPAN


    my $tempdir = Path::Tiny->tempdir;
    $result = test_app(
        'App::Dazz' => [
            qw(layout t/24_4.strand.fasta t/24_4.ovlp.tsv t/24_4.relation.tsv),
            qw(--oa t/24_4.anchor.ovlp.tsv -o),
            $tempdir->child('conTig.fasta'),
        ]
    );
    is( $result->error, undef, 'no exceptions' );
    is( ( scalar grep {/\S/} split( /\n/, $result->stderr ) ), 1, 'stderr line count' );
    is( ( scalar grep {/\S/} split( /\n/, $result->stdout ) ), 0, 'line count' );

    ok( $tempdir->child("conTig.fasta")->is_file, 'outfile exists' );

    is( scalar $tempdir->child("conTig.fasta")->lines, 2, 'line count' );
}

done_testing();



( run in 0.432 second using v1.01-cache-2.11-cpan-26ccb49234f )