tools: Ignore unfinished ascii escape codes.

- Ignore if the code doesn't end in 'm'.
This commit is contained in:
Andrew Hamilton 2019-07-21 23:00:35 +10:00
parent 7f9e572a18
commit ee27439a7c
2 changed files with 7 additions and 1 deletions

View file

@ -159,6 +159,9 @@ class TermStrTests(unittest.TestCase):
termstr.TermStr("foo").fg_color(13))
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "[105mfoo"),
termstr.TermStr("foo").bg_color(13))
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "(B" +
eris.terminal.ESC + "[mfoo"),
termstr.TermStr("foo"))
if __name__ == "__main__":