Skip to content

Commit a8fbeaf

Browse files
committed
[TEST] i/o - checking .fasta_ignore_blanks_before_id option works
1 parent 0345900 commit a8fbeaf

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

test/unit/io/sequence_file/sequence_file_integration_test.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,41 @@ TEST(rows, assign_sequence_files)
4747
EXPECT_EQ(reinterpret_cast<std::ostringstream&>(fout.get_stream()).str(), output_comp);
4848
}
4949

50+
TEST(rows, assign_sequence_files_read_blanks)
51+
{
52+
std::string const input
53+
{
54+
">TEST 1\n"
55+
"ACGT\n"
56+
"> Test2\n"
57+
"AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN AGGCTGN\n\n"
58+
"> Test3\n"
59+
"GGAGTATAATATATATATATATAT\n"
60+
};
61+
62+
std::string const output_comp
63+
{
64+
">TEST 1\n"
65+
"ACGT\n"
66+
"> Test2\n"
67+
"AGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGNAGGCTGN\n"
68+
"> Test3\n"
69+
"GGAGTATAATATATATATATATAT\n"
70+
};
71+
72+
seqan3::sequence_file_input fin{std::istringstream{input}, seqan3::format_fasta{}};
73+
fin.options.fasta_ignore_blanks_before_id = false;
74+
75+
seqan3::sequence_file_output fout{std::ostringstream{}, seqan3::format_fasta{}};
76+
fout.options.fasta_letters_per_line = 0;
77+
78+
fout = fin;
79+
80+
fout.get_stream().flush();
81+
EXPECT_EQ(reinterpret_cast<std::ostringstream&>(fout.get_stream()).str(), output_comp);
82+
}
83+
84+
5085
TEST(integration, assign_sequence_file_pipes)
5186
{
5287
std::string const input

0 commit comments

Comments
 (0)