import unittest
from fastcomp import compare

#
# Testing with binary patterns

PATTERNS = ['111', '101', '011', '110', '100', '010', '001', '000',
            '11', '10', '01', '00', '1', '0', '']

MATRIX_L = [
    [ 0, 1, 1, 1, 2, 2, 2,-1, 1, 2, 2,-1, 2,-1,-1],
    [ 1, 0, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2,-1],
    [ 1, 2, 0, 2,-1, 1, 1, 2, 1, 2, 1, 2, 2, 2,-1],
    [ 1, 2, 2, 0, 1, 1,-1, 2, 1, 1, 2, 2, 2, 2,-1],
    [ 2, 1,-1, 1, 0, 2, 2, 1, 2, 1, 2, 1, 2, 2,-1],
    [ 2, 2, 1, 1, 2, 0, 2, 1, 2, 1, 1, 1, 2, 2,-1],
    [ 2, 1, 1,-1, 2, 2, 0, 1, 2, 2, 1, 1, 2, 2,-1],
    [-1, 2, 2, 2, 1, 1, 1, 0,-1, 2, 2, 1,-1, 2,-1],
    [ 1, 1, 1, 1, 2, 2, 2,-1, 0, 1, 1, 2, 1, 2, 2],
    [ 2, 1, 2, 1, 1, 1, 2, 2, 1, 0, 2, 1, 1, 1, 2],
    [ 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 0, 1, 1, 1, 2],
    [-1, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 0, 2, 1, 2],
    [ 2, 2, 2, 2, 2, 2, 2,-1, 1, 1, 1, 2, 0, 1, 1],
    [-1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 1],
    [-1,-1,-1,-1,-1,-1,-1,-1, 2, 2, 2, 2, 1, 1, 0]
]

MATRIX_DL = [
    [ 0, 1, 1, 1, 2, 2, 2,-1, 1, 2, 2,-1, 2,-1,-1],
    [ 1, 0, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2,-1],
    [ 1, 1, 0, 2, 2, 1, 1, 2, 1, 2, 1, 2, 2, 2,-1],
    [ 1, 1, 2, 0, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2,-1],
    [ 2, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 2, 2,-1],
    [ 2, 2, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 2, 2,-1],
    [ 2, 1, 1, 2, 2, 1, 0, 1, 2, 2, 1, 1, 2, 2,-1],
    [-1, 2, 2, 2, 1, 1, 1, 0,-1, 2, 2, 1,-1, 2,-1],
    [ 1, 1, 1, 1, 2, 2, 2,-1, 0, 1, 1, 2, 1, 2, 2],
    [ 2, 1, 2, 1, 1, 1, 2, 2, 1, 0, 1, 1, 1, 1, 2],
    [ 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 0, 1, 1, 1, 2],
    [-1, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 0, 2, 1, 2],
    [ 2, 2, 2, 2, 2, 2, 2,-1, 1, 1, 1, 2, 0, 1, 1],
    [-1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 1],
    [-1,-1,-1,-1,-1,-1,-1,-1, 2, 2, 2, 2, 1, 1, 0]
]

class TestBinaryPattern(unittest.TestCase):
    def test_levenshtein(self):
        for i, s1 in enumerate(PATTERNS):
            for j, s2 in enumerate(PATTERNS):
                self.assertEqual(compare(s1, s2), MATRIX_L[i][j])

    def test_damerau_levenshtein(self):
        for i, s1 in enumerate(PATTERNS):
            for j, s2 in enumerate(PATTERNS):
                self.assertEqual(compare(s1, s2, True), MATRIX_DL[i][j])

if __name__ == '__main__':
    unittest.main()

Add exhausive testing with binary patterns.