-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TEST] Adding cli tests for detect_breakends.
- Loading branch information
Simon Sasse
committed
Oct 2, 2020
1 parent
7d73714
commit 8c1a745
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#include <seqan3/alphabet/nucleotide/dna5.hpp> | ||
#include <seqan3/io/sequence_file/input.hpp> | ||
|
||
#include "cli_test.hpp" | ||
|
||
TEST_F(cli_test, no_options) | ||
{ | ||
cli_test_result result = execute_app("detect_breakends"); | ||
std::string expected | ||
{ | ||
"detectJunctions - Detect junctions in a read alignment file\n" | ||
"===========================================================\n" | ||
" Try -h or --help for more information.\n" | ||
}; | ||
EXPECT_EQ(result.exit_code, 0); | ||
EXPECT_EQ(result.out, expected); | ||
EXPECT_EQ(result.err, std::string{}); | ||
} | ||
|
||
TEST_F(cli_test, fail_no_argument) | ||
{ | ||
cli_test_result result = execute_app("detect_breakends", "-v"); | ||
std::string expected | ||
{ | ||
"[Error] Unknown option -v. In case this is meant to be a non-option/argument/parameter, please specify " | ||
"the start of non-options with '--'. See -h/--help for program information.\n" | ||
}; | ||
EXPECT_NE(result.exit_code, 0); | ||
EXPECT_EQ(result.out, std::string{}); | ||
EXPECT_EQ(result.err, expected); | ||
} | ||
|
||
TEST_F(cli_test, with_arguments) | ||
{ | ||
cli_test_result result = execute_app("detect_breakends", | ||
data("converted_bam_shorted.sam"), | ||
"detect_breakends_out_short_10.fasta"); | ||
std::string expected | ||
{ | ||
"Reference\tchr9\t70103073\tForward\tReference\tchr9\t70103147\tForward\tm13802/6999/CCS\n" | ||
}; | ||
std::string expected_err | ||
{ | ||
"DEL: Reference\tchr9\t70103073\tForward\tReference\tchr9\t70103147\tForward\tm13802/6999/CCS\nDone. Found 1 junctions.\n" | ||
}; | ||
EXPECT_EQ(result.exit_code, 0); | ||
EXPECT_EQ(result.out, expected); | ||
EXPECT_EQ(result.err, expected_err); | ||
} | ||
|
||
// There is no verbose mode for "detect_breakends". | ||
// | ||
// TEST_F(cli_test, with_argument_verbose) | ||
// { | ||
// cli_test_result result = execute_app("detect_breakends", | ||
// data("converted_bam_shorted.sam"), | ||
// data("detect_breakends_out_short_10.fasta"), | ||
// "-v"); | ||
// EXPECT_EQ(result.exit_code, 0); | ||
// EXPECT_EQ(result.out, result); | ||
// EXPECT_EQ(result.err, "Conversion was a success. Congrats!\n"); | ||
// } | ||
// | ||
// there is no file output option for "detect_breakends" | ||
// | ||
// TEST_F(cli_test, with_out_file) | ||
// { | ||
// cli_test_result result = execute_app("detect_breakends", | ||
// data("converted_bam_shorted.sam"), | ||
// data("detect_breakends_out_short_10.fasta"), | ||
// ); | ||
// seqan3::sequence_file_input fin{"out.fasta", seqan3::fields<seqan3::field::seq, seqan3::field::id>{}}; | ||
// | ||
// // create records to compare | ||
// using record_type = typename decltype(fin)::record_type; | ||
// using seqan3::operator""_dna5; | ||
// std::vector<record_type> records{}; | ||
// records.emplace_back("ACGTTTGATTCGCG"_dna5, std::string{"seq1"}); | ||
// records.emplace_back("TCGGGGGATTCGCG"_dna5, std::string{"seq2"}); | ||
// | ||
// EXPECT_RANGE_EQ(fin, records); | ||
// EXPECT_EQ(result.exit_code, 0); | ||
// EXPECT_EQ(result.out, std::string{}); | ||
// EXPECT_EQ(result.err, std::string{}); | ||
// } | ||
// | ||
|