Skip to content

Commit

Permalink
[TEST] Adapt user_bin_io_test to multi filenames.
Browse files Browse the repository at this point in the history
  • Loading branch information
smehringer authored and eseiler committed Dec 6, 2023
1 parent dba6672 commit 8521f01
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/api/layout/user_bin_io_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@

TEST(output, user_bins)
{
std::vector<std::vector<std::string>> const filenames{{"file1.fa"}, {"file2.fa"}, {"path/to/file3.fa"}, {"file4.fastq"}};
std::vector<std::vector<std::string>> const filenames{{"file1.fa", "fileB.fa"},
{"file2.fa"},
{"path/to/file3.fa"},
{"file4.fastq"}};

std::stringstream ss{};
chopper::layout::write_user_bins_to(filenames, ss);

std::string const expected{"@CHOPPER_USER_BINS\n"
"@0 file1.fa\n"
"@0 file1.fa fileB.fa\n"
"@1 file2.fa\n"
"@2 path/to/file3.fa\n"
"@3 file4.fastq\n"
Expand All @@ -27,14 +30,14 @@ TEST(output, user_bins)
TEST(input, user_bins)
{
std::stringstream ss{"@CHOPPER_USER_BINS\n"
"@0 file1.fa\n"
"@0 file1.fa fileB.fa\n"
"@1 file2.fa\n"
"@2 path/to/file3.fa\n"
"@3 file4.fastq\n"
"@CHOPPER_USER_BINS_END\n"};

std::vector<std::vector<std::string>> filenames = chopper::layout::read_filenames_from(ss);
std::vector<std::vector<std::string>> const expected{{"file1.fa"},
std::vector<std::vector<std::string>> const expected{{"file1.fa", "fileB.fa"},
{"file2.fa"},
{"path/to/file3.fa"},
{"file4.fastq"}};
Expand Down

0 comments on commit 8521f01

Please sign in to comment.