1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#include "btllib/seq_reader.hpp"
#include "btllib/util.hpp"
#include "helpers.hpp"
#include <iostream>
#include <memory>
int
main()
{
const char* ids[] = { "asdf", "ghjk" };
const char* seqs[] = { "ACTG", "TGCA" };
for (int iteration = 0; iteration < 3; iteration++) {
std::cerr << "Iteration " << iteration + 1 << std::endl;
std::cerr << "Test small FASTA" << std::endl;
btllib::SeqReader reader(btllib::get_dirname(__FILE__) +
"/input.fa.gz.bz2.xz",
btllib::SeqReader::Flag::SHORT_MODE);
TEST_ASSERT_EQ(reader.get_format(), btllib::SeqReader::Format::FASTA)
size_t i = 0;
for (const auto record : reader) {
TEST_ASSERT_EQ(record.id, ids[i]);
TEST_ASSERT_EQ(record.seq, seqs[i]);
TEST_ASSERT_EQ(record.qual, "");
i++;
}
TEST_ASSERT_EQ(i, 2);
}
return 0;
}
|