Пример #1
0
def test_empty():
    s = ""
    assert parenthetics.parens(s) == 0
Пример #2
0
def test_broken():
    s = "()(q))"
    assert parenthetics.parens(s) == -1
Пример #3
0
def test_broken2():
    s = ")))(y(("
    assert parenthetics.parens(s) == -1
Пример #4
0
def test_balanced2():
    s = "(((klmn)))k()((p))"
    assert parenthetics.parens(s) == 0
Пример #5
0
def test_balanced():
    s = "()()()"
    assert parenthetics.parens(s) == 0
Пример #6
0
def test_open2():
    s = "((c(ab()d"
    assert parenthetics.parens(s) == 1
Пример #7
0
def test_open():
    s = "("
    assert parenthetics.parens(s) == 1
Пример #8
0
def test_no_parens():
    s = 'no parens'
    assert parenthetics.parens(s) == 0