Sha256: 0040455fcea2956b71911d679cf9fcef18081ef44ff9f218e8722f59f26ecece
Contents?: true
Size: 960 Bytes
Versions: 125
Compression:
Stored size: 960 Bytes
Contents
import unittest from bracket_push import check_brackets class BracketPushTests(unittest.TestCase): def test_input_empty(self): self.assertEqual(check_brackets(""), True) def test_single(self): self.assertEqual(check_brackets("{}"), True) def test_unclosed(self): self.assertEqual(check_brackets("{{"), False) def test_wrong_order(self): self.assertEqual(check_brackets("}{"), False) def test_mixed_not_nested(self): self.assertEqual(check_brackets("{}[]"), True) def test_mixed_nested(self): self.assertEqual(check_brackets("{[]}"), True) def test_improperly_nested(self): self.assertEqual(check_brackets("{[}]"), False) def test_not_opened_nested(self): self.assertEqual(check_brackets("{[)][]}"), False) def test_nested_ensemble(self): self.assertEqual(check_brackets("{[]([()])}"), True) if __name__ == '__main__': unittest.main()
Version data entries
125 entries across 125 versions & 1 rubygems