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