]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_ruby/test/maasha/test_seq.rb
added ambiguity to hamming_distance
[biopieces.git] / code_ruby / test / maasha / test_seq.rb
index 5947ee874666102cf6ef61f3ab8f8ff90516a2ef..bbb6759277359c0254275cc92101bd00c113abe6 100755 (executable)
@@ -304,6 +304,14 @@ class TestSeq < Test::Unit::TestCase
     assert_equal(1, seq1.hamming_distance(seq2))
   end
 
+  test "#hamming_distance with ambiguity codes return correctly" do
+    seq1 = Seq.new("test1", "ATCG")
+    seq2 = Seq.new("test2", "atng")
+
+    assert_equal(1, seq1.hamming_distance(seq2))
+    assert_equal(0, seq1.hamming_distance(seq2, ambiguity: true))
+  end
+
   test "#edit_distance returns correctly" do
     seq1 = Seq.new("test1", "ATCG")
     seq2 = Seq.new("test2", "tgncg")