Skip to content

Commit

Permalink
[TEST] i/o - checking .fasta_ignore_blank_before_id option works
Browse files Browse the repository at this point in the history
  • Loading branch information
SGSSGene committed Oct 26, 2021
1 parent 6357b00 commit fd3d739
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/unit/io/sequence_file/sequence_file_integration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@ TEST(rows, assign_sequence_files)
EXPECT_EQ(reinterpret_cast<std::ostringstream&>(fout.get_stream()).str(), output_comp);
}

TEST(rows, assign_sequence_files_read_blanks)
{
std::string const input
{
">TEST 1\n"
"ACGT\n"
"> Test2\n"
"AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN\n\n"
"> Test3\n"
"GGAGTATAATATATATATATATAT\n"
};

std::string const output_comp
{
"> TEST 1\n"
"ACGT\n"
"> Test2\n"
"AGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGN\n"
"> Test3\n"
"GGAGTATAATATATATATATATAT\n"
};

seqan3::sequence_file_input fin{std::istringstream{input}, seqan3::format_fasta{}};
seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}};
fout.options.fasta_letters_per_line = 0;
fout.options.fasta_ignore_blank_before_id = false;

fout = fin;

fout.get_stream().flush();
EXPECT_EQ(reinterpret_cast<std::ostringstream&>(fout.get_stream()).str(), output_comp);
}


TEST(integration, assign_sequence_file_pipes)
{
std::string const input
Expand Down

0 comments on commit fd3d739

Please sign in to comment.