Ejemplo n.º 1
0
def test_diff_lines_same():
    A = ['first line', 'second line']
    B = ['first line', 'second line']

    result = lines_diff(A, B)
    assert result[0]['state'] == 'unchanged'
    assert result[1]['state'] == 'unchanged'
Ejemplo n.º 2
0
def test_diff_lines_same():
    A = ['first line', 'second line']
    B = ['first line', 'second line']

    result = lines_diff(A, B)
    assert result[0]['state'] == 'unchanged'
    assert result[1]['state'] == 'unchanged'
Ejemplo n.º 3
0
def test_diff_lines7():
    A = ['first line', 'second line']
    B = ['first line', 'first line', 'second line']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'unchanged'
    assert result[1]['state'] == 'modified'
    assert result[2]['state'] == 'added'
Ejemplo n.º 4
0
def test_diff_lines5():
    A = ['test', ' ']
    B = ['diff']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
    assert result[1]['state'] == 'deleted'
    assert result[2]['state'] == 'added'
Ejemplo n.º 5
0
def test_diff_lines2():
    A = ['this is a line', 'another line']
    B = ['first line', 'another line']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
    assert result[1]['state'] == 'modified'
    assert result[2]['state'] == 'added'
Ejemplo n.º 6
0
def test_diff_lines7():
    A = ['first line', 'second line']
    B = ['first line', 'first line', 'second line']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'unchanged'
    assert result[1]['state'] == 'modified'
    assert result[2]['state'] == 'added'
Ejemplo n.º 7
0
def test_diff_lines5():
    A = ['test', ' ']
    B = ['diff']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
    assert result[1]['state'] == 'deleted'
    assert result[2]['state'] == 'added'
Ejemplo n.º 8
0
def test_diff_lines2():
    A = ['this is a line', 'another line']
    B = ['first line', 'another line']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
    assert result[1]['state'] == 'modified'
    assert result[2]['state'] == 'added'
Ejemplo n.º 9
0
def test_diff_lines4():
    A = ['fist line', 'first line']
    B = ['first lin', 'second one', 'first lin']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
    assert result[1]['state'] == 'modified'
    assert result[2]['state'] == 'added'
    assert result[3]['state'] == 'added'
Ejemplo n.º 10
0
def test_diff_lines4():
    A = ['fist line', 'first line']
    B = ['first lin', 'second one', 'first lin']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
    assert result[1]['state'] == 'modified'
    assert result[2]['state'] == 'added'
    assert result[3]['state'] == 'added'
Ejemplo n.º 11
0
def test_empty_lines():
    A = ['this is a line']
    B = ['']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
Ejemplo n.º 12
0
def test_diff_lines10():
    A = ['']
    B = ['']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'unchanged'
Ejemplo n.º 13
0
def test_empty_lines():
    A = ['this is a line']
    B = ['']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'deleted'
Ejemplo n.º 14
0
def test_diff_lines10():
    A = ['']
    B = ['']

    result = lines_diff(A, B, check_modified=True)
    assert result[0]['state'] == 'unchanged'