Пример #1
0
def test_normal_in():
    matrix = [
        [A, B, T, G],
        [C, F, C, S],
        [J, D, E, H]]
    string = "BFCE"
    assert has_path(matrix, string) == True
Пример #2
0
def test_same_element_not_in():
    matrix = [
        [A, A, A, A],
        [A, A, A, A],
        [A, A, A, A]]
    string = "AAAAAAAAAAAAA"
    assert has_path(matrix, string) == False
Пример #3
0
def test_normal_not_in():
    matrix = [
        [A, B, T, G],
        [C, F, C, S],
        [J, D, E, H]]
    string = "ABFB"
    assert has_path(matrix, string) == False
Пример #4
0
def test_corner_in():
    matrix = [
        [A, B, C, E],
        [S, F, C, S],
        [A, D, E, E]]
    string = "SEE"
    assert has_path(matrix, string) == True
Пример #5
0
def test_long_string_border_repeat_not_in():
    matrix = [
        [A, B, C, E, H, J, I, G],
        [S, F, C, S, L, O, P, Q],
        [A, D, E, E, M, N, O, E],
        [A, D, I, D, E, J, F, M],
        [V, C, E, I, F, G, G, S]]
    string = "SGGFIECVAASABCEHJIGQEMS"
    assert has_path(matrix, string) == False
Пример #6
0
def test_long_string_in():
    matrix = [
        [A, B, C, E, H, J, I, G],
        [S, F, C, S, L, O, P, Q],
        [A, D, E, E, M, N, O, E],
        [A, D, I, D, E, J, F, M],
        [V, C, E, I, F, G, G, S]]
    string = "SLHECCEIDEJFGGFIE"
    assert has_path(matrix, string) == True
Пример #7
0
def test_single_in():
    matrix = [[A]]
    string = "A"
    assert has_path(matrix, string) == True
Пример #8
0
def test_string_none():
    matrix = [[A]]
    string = ""
    assert has_path(matrix, string) == True
Пример #9
0
def test_matrix_none():
    matrix = [[]]
    string = "A"
    assert has_path(matrix, string) == False
Пример #10
0
def test_single_not_in():
    matrix = [[A]]
    string = "B"
    assert has_path(matrix, string) == False