Beispiel #1
0
def test_string():
    x = unbalenced('hello world')
    assert x == -1
Beispiel #2
0
def test_matched_simple():
    x = unbalenced('{}')
    assert x == -1
Beispiel #3
0
def test_unmatched_middle():
    x = unbalenced('{}{foo{}')
    assert x == 2
Beispiel #4
0
def test_unmatched_close():
    x = unbalenced('}')
    assert x == 0
Beispiel #5
0
def test_unmatched_open():
    x = unbalenced('{{{}')
    assert x == 0
Beispiel #6
0
def test_matched_nested():
    x = unbalenced('{{}{}}')
    assert x == -1
Beispiel #7
0
def test_matched_mixed():
    x = unbalenced('{{{foo();}}}{}')
    assert x == -1