X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=alg%2Ftest%2Ftest_mussa.cpp;h=e1cef22fb6cda9e9213e04e0642bd6306e05a8ab;hb=6d25d4d945af696134bdf788b111f38b197b1a15;hp=16068473c01500185aedec71871fd90cd1818374;hpb=516c775c2bc35f526a223e3f6968cbd1f8fa3402;p=mussa.git diff --git a/alg/test/test_mussa.cpp b/alg/test/test_mussa.cpp index 1606847..e1cef22 100644 --- a/alg/test/test_mussa.cpp +++ b/alg/test/test_mussa.cpp @@ -110,6 +110,25 @@ BOOST_AUTO_TEST_CASE ( empty_mussa_set_threshold ) m.nway(); } +BOOST_AUTO_TEST_CASE( mussa_load_mupa_crlf ) +{ + fs::path example_path(EXAMPLE_DIR, fs::native); + fs::path seq_path(example_path / "seq" / "mouse_mck_pro.fa"); + fs::path annot_path(example_path / "mm_mck3test.annot"); + + std::string mupa( + "# hello\015\012" + "ANA_NAME load_mupa_crlf\015\012"); + mupa += "SEQUENCE " + seq_path.native_file_string() + "\015\012"; + mupa += "ANNOTATION " + annot_path.native_file_string() + "\015\012"; + + istringstream mupa_stream(mupa); + Mussa m; + fs::path base; + m.load_mupa_stream( mupa_stream, base ); + // Should run with no exceptions +} + BOOST_AUTO_TEST_CASE( mussa_load_mupa ) { fs::path mupa_path(EXAMPLE_DIR, fs::native); @@ -152,6 +171,17 @@ BOOST_AUTO_TEST_CASE( mussa_load_full_path ) BOOST_CHECK_EQUAL( m1.is_dirty(), true); BOOST_CHECK_EQUAL( m1.get_analysis_path().string(), ""); } + +BOOST_AUTO_TEST_CASE( mussa_valid_motifs_in_new_analysis ) +{ + Mussa m1; + fs::path full_path(fs::path(EXAMPLE_DIR, fs::native) / "mck3test.mupa"); + m1.load_mupa_file( full_path ); + m1.analyze(); + // check motifs + BOOST_CHECK( m1.sequences().size() > 0 ); + BOOST_CHECK_EQUAL( m1.sequences()[0]->motifs().size(), 0 ); +} // make sure we know that mupa files cannot be directories BOOST_AUTO_TEST_CASE( mussa_mupa_is_file_not_directory )