+BOOST_AUTO_TEST_CASE( sequence_load_error )
+{
+ fs::path seq_path(fs::path(EXAMPLE_DIR, fs::native)/"seq");
+ seq_path /= "broken.fa";
+ bool exception_thrown = false;
+ std::string exception_filename;
+ Sequence s;
+ try {
+ s.load_fasta(seq_path);
+ } catch(sequence_invalid_load_error e) {
+ exception_thrown = true;
+ size_t native_string_size = seq_path.native_file_string().size();
+ std:string estr(e.what());
+ 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(seq_path.native_file_string(), exception_filename);
+}
+