Пример #1
0
 def test_literal_curly_braces(self):
     just_braces = "a{bc}"
     just_braces_result = bcp.process_string(just_braces)
     self.assertEqual(just_braces, just_braces_result)
     unclosed_brace = "a{b,c"
     unclosed_brace_result = bcp.process_string(unclosed_brace)
     self.assertEqual(unclosed_brace, unclosed_brace_result)
Пример #2
0
 def test_product_escape_sequences(self):
     escaped_braces = "a\{b,c\}"
     escaped_comma = "a{b\,c}"
     escaped_expected = "a{b,c}"
     escaped_braces_result = bcp.process_string(escaped_braces)
     self.assertEqual(escaped_expected, escaped_braces_result)
     escaped_comma_result = bcp.process_string(escaped_comma)
     self.assertEqual(escaped_expected, escaped_comma_result)
Пример #3
0
 def test_example_one(self):
     raw = "a{b,c}d{e,f,g}hi"
     expected = "abdehi abdfhi abdghi acdehi acdfhi acdghi"
     result = bcp.process_string(raw)
     self.assertEqual(expected, result)
Пример #4
0
 def test_escaped_spaces(self):
     raw = "a{b,c}\ d{e,f}"
     expected = "ab de ab df ac de ac df"
     result = bcp.process_string(raw)
     self.assertEqual(expected, result)
Пример #5
0
 def test_plain_string(self):
     raw = "asdf"
     result = bcp.process_string(raw)
     self.assertEqual(raw, result)
Пример #6
0
 def test_empty_string(self):
     result = bcp.process_string("")
     self.assertEqual("", result)
Пример #7
0
 def test_example_two(self):
     raw = "a{b,c{d,e,f}g,h}ij{k,l}"
     expected = "abijk abijl acdgijk acdgijl acegijk acegijl acfgijk acfgijl ahijk ahijl"
     result = bcp.process_string(raw)
     self.assertEqual(expected, result)