8 #include <boost/test/unit_test.hpp> 10 struct fasta_operations_fixture
12 std::string name, seq;
13 fasta_operations_fixture()
14 : name{
"seqname" }, seq{
"AGCGTAGACAGTAGAGTGAT" }
19 BOOST_FIXTURE_TEST_SUITE(FastaOperationsTest, fasta_operations_fixture)
22 std::string rcom(
const std::string & s )
25 std::reverse(rv.begin(),rv.end());
26 std::transform(rv.begin(),rv.end(),
51 BOOST_AUTO_TEST_CASE( revcom )
53 std::string name(
"seqname"),seq(
"AGCGTAGACAGTAGAGTGAT");
59 BOOST_REQUIRE( f2.seq == rcom(seq) );
62 BOOST_AUTO_TEST_CASE( subseq )
64 std::string name(
"seqname"),seq(
"AGCGTAGACAGTAGAGTGAT");
70 BOOST_REQUIRE( f3.seq ==
"GCG" );
74 BOOST_REQUIRE( f3.seq ==
"CGC" );
76 BOOST_REQUIRE( std::string(f3) ==
"CGC" );
81 BOOST_AUTO_TEST_CASE( gapped )
85 BOOST_REQUIRE( !f3.IsGapped() );
89 BOOST_REQUIRE( f3.IsGapped() );
91 BOOST_REQUIRE( f3.length() == 4 );
93 BOOST_REQUIRE( f3.UngappedLength() == 3 );
96 f3.seq.erase( f3.seq.find(
'-'), 1 );
98 BOOST_REQUIRE( f3.length() == 3 );
100 BOOST_REQUIRE( f3.UngappedLength() == 3 );
103 BOOST_AUTO_TEST_CASE( cpp11access_1 )
110 BOOST_REQUIRE_EQUAL(f3.seq,
"AAA");
113 BOOST_AUTO_TEST_SUITE_END()
Declaration of Sequence::Fasta streams.