def test_mismatched():
    assert is_balanced("This is a string with )))))(((((( wrong order") == -1
Esempio n. 2
0
def test_withstring():
    assert is_balanced("this is a (string) with open and close") == 0
def test_withstring():
    assert is_balanced("this is a (string) with open and close") == 0
def test_jumbled_up():
    assert is_balanced("(()()))()") == -1
def test_will_it_break():
    assert is_balanced("()())(())(())(((") == -1
def test_three():
    assert is_balanced("(((this is some text)))some more text") == 0
def test_empty():
    assert is_balanced("") == 0
Esempio n. 8
0
def test_empty():
    assert is_balanced("") == 0
Esempio n. 9
0
def test_no_paren():
    assert is_balanced("this is text no parenthesis") == 0
Esempio n. 10
0
def test_three():
    assert is_balanced("(((this is some text)))some more text") == 0
Esempio n. 11
0
def test_three_unballanced():
    assert is_balanced("(((text))))(") == -1
Esempio n. 12
0
def test_greater_than_one():
    assert is_balanced("(((") == 1
Esempio n. 13
0
def test_bug():
    assert is_balanced("()(") == 1
Esempio n. 14
0
def test_mismatched():
    assert is_balanced("This is a string with )))))(((((( wrong order") == -1
def test_bug():
    assert is_balanced("()(") == 1
Esempio n. 16
0
def test_jumbled_up():
    assert is_balanced("(()()))()") == -1
def test_greater_than_one():
    assert is_balanced("(((") == 1
Esempio n. 18
0
def test_isone():
    assert is_balanced("(") == 1
def test_three_unballanced():
    assert is_balanced("(((text))))(") == -1
Esempio n. 20
0
def test_will_it_break():
    assert is_balanced("()())(())(())(((") == -1
def test_no_paren():
    assert is_balanced("this is text no parenthesis") == 0
Esempio n. 22
0
def test_isneg():
    assert is_balanced(")") == -1
def test_isone():
    assert is_balanced("(") == 1
def test_iszero():
    assert is_balanced("( )") == 0
def test_isneg():
    assert is_balanced(")") == -1
Esempio n. 26
0
def test_iszero():
    assert is_balanced("( )") == 0