-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TEST] Adding cli tests for detect_breakends. #19
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,70 @@ | ||
#include <seqan3/alphabet/nucleotide/dna5.hpp> | ||
#include <seqan3/io/sequence_file/input.hpp> | ||
|
||
#include "cli_test.hpp" | ||
#include <fstream> | ||
#include <sstream> | ||
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_insertion_file_out.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); | ||
} | ||
|
||
TEST_F(cli_test, test_outfile) | ||
{ | ||
cli_test_result result = execute_app("detect_breakends", | ||
data("converted_bam_shorted.sam"), | ||
"detect_breakends_insertion_file_out.fasta"); | ||
std::ifstream f; | ||
f.open("detect_breakends_insertion_file_out.fasta"); | ||
std::stringstream buffer; | ||
buffer << f.rdbuf(); | ||
//expected string currently empty: | ||
std::string expected | ||
{ | ||
"" | ||
}; | ||
//this does not specifically check if file exists, rather if its readable. | ||
EXPECT_TRUE(f.is_open()); | ||
EXPECT_EQ(buffer.str(), expected); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without these lined the cli tests won't work.