try to read fasta blocks in the annotation file
[mussa.git] / alg / test / test_sequence.cpp
index 1e478fa4cf5a66e721a8187eef346ef06d133947..c2dea4e4f4cfb11a21b35679abefe5d1247d9fc5 100644 (file)
@@ -67,24 +67,31 @@ BOOST_AUTO_TEST_CASE( sequence_load )
 BOOST_AUTO_TEST_CASE( annotation_load )
 {
   string annot_data = "human\n"
-                      "0 10 name type\n"
-                      "10 20 name\n"
-                      "20 30\n"
-                      "15 20 backward\n";
+                      "0 10 name\n" // type\n"
+                      "10 20 myf\n"
+                      "20 30 myod\n"
+                      "50\t55 anothername\n"
+                      "60 50 backward\n"
+                      ">ident\n"
+                      "GCT\n"
+                      "GCT\n"
+                      ;
   string s('A',100);
   s += "GCTGCT";
   Sequence seq(s);
                      
   //istringstream annot_stream(annot_data);
   seq.parse_annot(annot_data, 0, 0);
-  typedef std::list<annot> annot_list_t;
-  annot_list_t annots = seq.annotations();
-  for(annot_list_t::iterator annot_i = annots.begin();
-      annot_i != annots.end();
-      ++annot_i)
-  {
-    std::cout << "start " << annot_i->start << endl;
-  }
+  std::list<annot> annots_list = seq.annotations();
+  std::vector<annot> annots(annots_list.begin(), annots_list.end());
+  BOOST_REQUIRE_EQUAL( annots.size(), 5);
+  BOOST_CHECK_EQUAL( annots[0].start, 0 );
+  BOOST_CHECK_EQUAL( annots[0].end, 10 );
+  //BOOST_CHECK_EQUAL( annots[0].type, "type");
+  BOOST_CHECK_EQUAL( annots[0].name, "name");
+  //BOOST_CHECK_EQUAL( annots[1].name, "myf7");
+
+  //BOOST_CHECK_EQUAL( annots
 }
 
 // ticket:83 when you try to load a sequence from a file that doesn't