[BioRuby-cvs] bioruby/test/unit/bio/sequence test_aa.rb, 1.4, 1.5 test_common.rb, 1.4, 1.5 test_na.rb, 1.5, 1.6

Mitsuteru C. Nakao nakao at dev.open-bio.org
Mon Dec 3 06:19:14 UTC 2007


Update of /home/repository/bioruby/bioruby/test/unit/bio/sequence
In directory dev.open-bio.org:/tmp/cvs-serv11507/test/unit/bio/sequence

Modified Files:
	test_aa.rb test_common.rb test_na.rb 
Log Message:
* Fixed Bio::Sequence::NA#concat bug reported by Dr. M. Matsuzaki. 
* Added tests for concat and << for Bio::Sequence::NA and AA.



Index: test_common.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/sequence/test_common.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_common.rb	5 Apr 2007 23:35:44 -0000	1.4
--- test_common.rb	3 Dec 2007 06:19:12 -0000	1.5
***************
*** 32,35 ****
--- 32,39 ----
      end
  
+     def test_to_str
+       assert_equal('atgcatgcatgcatgcaaaa', @obj.to_str)
+     end
+ 
      def test_seq
        str = "atgcatgcatgcatgcaaaa"
***************
*** 37,41 ****
      end
  
- 
      # <<(*arg)
      def test_push
--- 41,44 ----
***************
*** 44,47 ****
--- 47,56 ----
      end
  
+     # concat(*arg)
+     def test_concat
+       str = "atgcatgcatgcatgcaaaaA"
+       assert_equal(str, @obj.concat("A"))
+     end
+ 
      # +(*arg)
      def test_sum 

Index: test_na.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/sequence/test_na.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** test_na.rb	5 Apr 2007 23:35:44 -0000	1.5
--- test_na.rb	3 Dec 2007 06:19:12 -0000	1.6
***************
*** 176,179 ****
--- 176,241 ----
    end
  
+   class TestSequenceCommon < Test::Unit::TestCase
+ 
+     def setup
+       @obj  = Bio::Sequence::NA.new('atgcatgcatgcatgcaaaa')
+     end
+ 
+     def test_to_s
+       assert_equal('atgcatgcatgcatgcaaaa', @obj.to_s)
+     end
+ 
+     def test_to_str
+       assert_equal('atgcatgcatgcatgcaaaa', @obj.to_str)
+     end
+ 
+     def test_seq
+       str = "atgcatgcatgcatgcaaaa"
+       assert_equal(str, @obj.seq)
+     end
+ 
+     # <<(*arg)
+     def test_push
+       str = "atgcatgcatgcatgcaaaaa"
+       assert_equal(str, @obj << "A")
+     end
+ 
+     # concat(*arg)
+     def test_concat
+       str = "atgcatgcatgcatgcaaaaa"
+       assert_equal(str, @obj.concat("A"))
+     end
+ 
+     # +(*arg)
+     def test_sum 
+       str = "atgcatgcatgcatgcaaaaatgcatgcatgcatgcaaaa"
+       assert_equal(str, @obj + @obj)
+     end
+ 
+     # window_search(window_size, step_size = 1)
+     def test_window_search
+       @obj.window_search(4) do |subseq|
+         assert_equal(20, @obj.size)
+       end
+     end
+ 
+     #total(hash)
+     def test_total
+       hash = {'a' => 1, 'c' => 2, 'g' => 4, 't' => 3}
+       assert_equal(44.0, @obj.total(hash))
+     end
+ 
+     def test_composition
+       composition = {"a"=>8, "c"=>4, "g"=>4, "t"=>4}
+       assert_equal(composition, @obj.composition)
+     end
+     
+     def test_splicing
+       #(position)
+       assert_equal("atgcatgc", @obj.splicing("join(1..4, 13..16)"))
+     end
+   end
+ 
+ 
    class TestSequenceNATranslation < Test::Unit::TestCase
      def setup

Index: test_aa.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/sequence/test_aa.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** test_aa.rb	14 Apr 2007 05:09:23 -0000	1.4
--- test_aa.rb	3 Dec 2007 06:19:12 -0000	1.5
***************
*** 20,25 ****
  module Bio
  
- 
    class TestSequenceAANew < Test::Unit::TestCase
      def test_new
        str = "RRLEHTFVFL RNFSLMLLRY"
--- 20,25 ----
  module Bio
  
    class TestSequenceAANew < Test::Unit::TestCase
+ 
      def test_new
        str = "RRLEHTFVFL RNFSLMLLRY"
***************
*** 87,90 ****
--- 87,91 ----
        assert_equal(ary, @obj.names)
      end
+ 
    end
  




More information about the bioruby-cvs mailing list