예제 #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