Skip to content

Commit

Permalink
[TEST] i/o - checking .fasta_ignore_blanks_before_id option works
Browse files Browse the repository at this point in the history
  • Loading branch information
SGSSGene committed Feb 9, 2022
1 parent 0345900 commit a8fbeaf
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 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,41 @@ 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{}};
fin.options.fasta_ignore_blanks_before_id = false;

seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}};
fout.options.fasta_letters_per_line = 0;

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 a8fbeaf

Please sign in to comment.