#!/usr/bin/env ruby
-$:.unshift File.join(File.dirname(__FILE__),'..','lib')
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..')
# Copyright (C) 2012 Martin A. Hansen.
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
require 'test/unit'
+require 'test/helper'
require 'maasha/align/matches'
-require 'pp'
class MatchesTest < Test::Unit::TestCase
- def test_Matches_find_with_no_match_returns_correctly
+ test "Matches.find with no match returns correctly" do
assert_equal("[]", Matches.find("atcg", "atcg", 0, 0, 3, 3, 8).to_s)
end
- def test_Matches_find_with_one_match_returns_correctly
+ test "Matches.find with one match returns correctly" do
assert_equal("[q: 2 3 s: 0 1 l: 2 s: 0.0]", Matches.find("01cg", "cg23", 0, 0, 3, 3, 2).to_s)
assert_equal("[q: 0 1 s: 2 3 l: 2 s: 0.0]", Matches.find("cg23", "01cg", 0, 0, 3, 3, 2).to_s)
end
- def test_Matches_find_with_two_matches_returns_correctly
+ test "Matches.find with two matches returns correctly" do
assert_equal("[q: 0 1 s: 0 1 l: 2 s: 0.0, q: 3 4 s: 3 4 l: 2 s: 0.0]", Matches.find("atXcg", "atYcg", 0, 0, 4, 4, 2).to_s)
assert_equal("[q: 0 1 s: 0 1 l: 2 s: 0.0, q: 3 4 s: 3 4 l: 2 s: 0.0]", Matches.find("atYcg", "atXcg", 0, 0, 4, 4, 2).to_s)
end
- def test_Matches_find_dont_expand_match_outside_space
+ test "Matches.find dont expand match outside space" do
assert_equal("[q: 1 2 s: 1 2 l: 2 s: 0.0]", Matches.find("atcg", "atcg", 1, 1, 2, 2, 2).to_s)
end
- def test_Matches_find_right_expands_correctly
+ test "Matches.find right expands correctly" do
assert_equal("[q: 0 3 s: 0 3 l: 4 s: 0.0]", Matches.find("atcg", "atcg", 0, 0, 3, 3, 3).to_s)
end
-# def test_Matches_find_left_expands_correctly
+# test "Matches.find left expands correctly" do
# flunk
# assert_equal("[q: 1 2 s: 1 2 l: 2 s: 0.0]", Matches.find("ccccc", "cccc", 0, 0, 3, 3, 2).to_s)
# end