]> git.donarmstrong.com Git - biopieces.git/commitdiff
refactor match->patmatch scan->patscan
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 5 Dec 2012 09:33:29 +0000 (09:33 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 5 Dec 2012 09:33:29 +0000 (09:33 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@2029 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/test/maasha/seq/test_patternmatcher.rb

index 42b1f636b7260e6e6bb1751265677a50216244ad..8327117c30529fb81d5839900276ceff0802c51e 100755 (executable)
@@ -41,11 +41,11 @@ class TestPatternMatcher < Test::Unit::TestCase
   end
 
   def test_PatternMatcher_no_match_returns_nil
-    assert_nil(@p.match("gggg"))
+    assert_nil(@p.patmatch("gggg"))
   end
 
-  def test_PatternMatcher_match_perfect_returns_correctly
-    m = @p.match("atcg")
+  def test_PatternMatcher_patmatch_perfect_returns_correctly
+    m = @p.patmatch("atcg")
     assert_equal(0, m.beg)
     assert_equal("atcg", m.match)
     assert_equal(0, m.mis)
@@ -54,8 +54,8 @@ class TestPatternMatcher < Test::Unit::TestCase
     assert_equal(4, m.length)
   end
 
-  def test_PatternMatcher_match_perfect_with_ambiguity_codes_returns_correctly
-    m = @p.match("nnnn")
+  def test_PatternMatcher_patmatch_perfect_with_ambiguity_codes_returns_correctly
+    m = @p.patmatch("nnnn")
     assert_equal(0, m.beg)
     assert_equal("atcg", m.match)
     assert_equal(0, m.mis)
@@ -64,12 +64,12 @@ class TestPatternMatcher < Test::Unit::TestCase
     assert_equal(4, m.length)
   end
 
-  def test_PatternMatcher_match_with_one_mismatch_and_edit_dist_zero_returns_nil
-    assert_nil(@p.match("aCcg"))
+  def test_PatternMatcher_patmatch_with_one_mismatch_and_edit_dist_zero_returns_nil
+    assert_nil(@p.patmatch("aCcg"))
   end
 
-  def test_PatternMatcher_match_with_one_mismatch_and_edit_dist_one_returns_correctly
-    m = @p.match("aCcg", 0, 1)
+  def test_PatternMatcher_patmatch_with_one_mismatch_and_edit_dist_one_returns_correctly
+    m = @p.patmatch("aCcg", 0, 1)
     assert_equal(0, m.beg)
     assert_equal("atcg", m.match)
     assert_equal(1, m.mis)
@@ -78,16 +78,16 @@ class TestPatternMatcher < Test::Unit::TestCase
     assert_equal(4, m.length)
   end
 
-  def test_PatternMatcher_match_with_two_mismatch_and_edit_dist_one_returns_nil
-    assert_nil(@p.match("aGcA", 0, 1))
+  def test_PatternMatcher_patmatch_with_two_mismatch_and_edit_dist_one_returns_nil
+    assert_nil(@p.patmatch("aGcA", 0, 1))
   end
 
-  def test_PatternMatcher_match_with_one_insertion_and_edit_dist_zero_returns_nil
-    assert_nil(@p.match("atGcg"))
+  def test_PatternMatcher_patmatch_with_one_insertion_and_edit_dist_zero_returns_nil
+    assert_nil(@p.patmatch("atGcg"))
   end
 
-  def test_PatternMatcher_match_with_one_insertion_and_edit_dist_one_returns_correctly
-    m = @p.match("atGcg", 0, 1)
+  def test_PatternMatcher_patmatch_with_one_insertion_and_edit_dist_one_returns_correctly
+    m = @p.patmatch("atGcg", 0, 1)
     assert_equal(0, m.beg)
     assert_equal("atcg", m.match)
     assert_equal(0, m.mis)
@@ -96,12 +96,12 @@ class TestPatternMatcher < Test::Unit::TestCase
     assert_equal(4, m.length)
   end
 
-  def test_PatternMatcher_match_with_two_insertions_and_edit_dist_one_returns_nil
-    assert_nil(@p.match("atGcTg", 0, 1))
+  def test_PatternMatcher_patmatch_with_two_insertions_and_edit_dist_one_returns_nil
+    assert_nil(@p.patmatch("atGcTg", 0, 1))
   end
 
-  def test_PatternMatcher_match_with_two_insertions_and_edit_dist_two_returns_correctly
-    m = @p.match("atGcTg", 0, 2)
+  def test_PatternMatcher_patmatch_with_two_insertions_and_edit_dist_two_returns_correctly
+    m = @p.patmatch("atGcTg", 0, 2)
     assert_equal(0, m.beg)
     assert_equal("atcg", m.match)
     assert_equal(0, m.mis)
@@ -110,12 +110,12 @@ class TestPatternMatcher < Test::Unit::TestCase
     assert_equal(4, m.length)
   end
 
-  def test_PatternMatcher_match_with_one_deletion_and_edit_distance_zero_returns_nil
-    assert_nil(@p.match("acg"))
+  def test_PatternMatcher_patmatch_with_one_deletion_and_edit_distance_zero_returns_nil
+    assert_nil(@p.patmatch("acg"))
   end
 
-  def test_PatternMatcher_match_with_one_deletion_and_edit_distance_one_returns_correctly
-    m = @p.match("acg", 0, 1)
+  def test_PatternMatcher_patmatch_with_one_deletion_and_edit_distance_one_returns_correctly
+    m = @p.patmatch("acg", 0, 1)
     assert_equal(0, m.beg)
     assert_equal("atcg", m.match)
     assert_equal(0, m.mis)
@@ -124,13 +124,13 @@ class TestPatternMatcher < Test::Unit::TestCase
     assert_equal(4, m.length)
   end
 
-  def test_PatternMatcher_scan_locates_three_patterns_ok
+  def test_PatternMatcher_patscan_locates_three_patterns_ok
     p = Seq.new("test", "ataacgagctagctagctagctgactac")
-    assert_equal(3, p.scan("tag").count)
+    assert_equal(3, p.patscan("tag").count)
   end
 
-  def test_PatternMatcher_scan_with_pos_locates_two_patterns_ok
+  def test_PatternMatcher_patscan_with_pos_locates_two_patterns_ok
     p = Seq.new("test", "ataacgagctagctagctagctgactac")
-    assert_equal(2, p.scan("tag", 10).count)
+    assert_equal(2, p.patscan("tag", 10).count)
   end
 end