Exemple #1
0
def test_equal_len():
    for i in range(10):
        s1 = [random.randint(0, 10) for i in range(random.randint(40, 50))]
        s2 = [random.randint(0, 10) for i in range(random.randint(40, 50))]
        ss = (s1, s2)
        assert dl.lcs_len(s1, s2) == dl.lcs_matrix(s1, s2)[-1][-1]
        both = dl.lcs_low_m_anlcs(s1, s2)
        assert both.length == dl.lcs_len(*ss)
        assert both.length == len(both.lcs)
Exemple #2
0
def test_equal_len():
    for i in range(10):
        s1 = [random.randint(0,10) for i in range(random.randint(40,50))]
        s2 = [random.randint(0,10) for i in range(random.randint(40,50))]
        ss = (s1,s2)
        assert dl.lcs_len(s1,s2) == dl.lcs_matrix(s1,s2)[-1][-1]
        both = dl.lcs_low_m_anlcs(s1,s2)
        assert both.length == dl.lcs_len(*ss)
        assert both.length == len(both.lcs)
Exemple #3
0
def test_empy_matrix():
    assert dl.lcs_matrix('', '') == []
Exemple #4
0
def test_empy_matrix():
    assert dl.lcs_matrix('','') == []