Exemplo n.º 1
0
 def test_empty(self):
     s = ''
     self.assertTrue(is_paranthesis_balanced(s))
Exemplo n.º 2
0
 def test_intersection(self):
     s = '([)]'
     self.assertFalse(is_paranthesis_balanced(s))
Exemplo n.º 3
0
 def test_close_without_open(self):
     s = '()]'
     self.assertFalse(is_paranthesis_balanced(s))
Exemplo n.º 4
0
 def test_open_without_close(self):
     s = '([)'
     self.assertFalse(is_paranthesis_balanced(s))
     s = '()['
     self.assertFalse(is_paranthesis_balanced(s))
Exemplo n.º 5
0
 def test_correct(self):
     s = '({[()]}{<>})'
     self.assertTrue(is_paranthesis_balanced(s))