"5' flank");
}
-BOOST_AUTO_TEST_CASE( sequence_load_error )
+BOOST_AUTO_TEST_CASE( sequence_load_fasta_error )
{
fs::path seq_path(fs::path(EXAMPLE_DIR, fs::native)/"seq");
seq_path /= "broken.fa";
BOOST_CHECK_EQUAL(seq_path.native_file_string(), exception_filename);
}
+BOOST_AUTO_TEST_CASE( sequence_load_annot_error )
+{
+ fs::path seq_path(fs::path(EXAMPLE_DIR, fs::native)/"seq");
+ seq_path /= "mouse_mck_pro.fa";
+ fs::path annot_path(fs::path(EXAMPLE_DIR, fs::native));
+ annot_path /= "broken.annot";
+ bool exception_thrown = false;
+ Sequence s;
+ s.load_fasta(seq_path);
+
+ std::string exception_filename;
+ try {
+ s.load_annot(annot_path, 0, 0);
+ } catch(annotation_load_error e) {
+ exception_thrown = true;
+ std:string estr(e.what());
+ size_t native_string_size = annot_path.native_file_string().size();
+ BOOST_REQUIRE(estr.size() > native_string_size);
+ std::copy(estr.begin(), estr.begin()+native_string_size,
+ std::back_inserter(exception_filename));
+ }
+ BOOST_CHECK_EQUAL(exception_thrown, true);
+ BOOST_CHECK_EQUAL(annot_path.native_file_string(), exception_filename);
+}
+
BOOST_AUTO_TEST_CASE( sequence_load_dna_reduced )
{
std::string reduced_dna_fasta_string(">foo\nAAGGCCTTNN\n");