    def test_ansi_terminal_parser_unknown(self):
        """
        Check AnsiTerminalParser ignores unknown codes.
        """
        parser = AnsiTerminalParser()
        parser.reset("a\x1B[2345£", None)
        tokens = parser.parse()
        self.assertEqual(next(tokens), (0, Parser.DISPLAY_TEXT, "a"))
        with self.assertRaises(StopIteration):
            next(tokens)

        parser.reset("a\x1B", None)
        tokens = parser.parse()
        self.assertEqual(next(tokens), (0, Parser.DISPLAY_TEXT, "a"))
        with self.assertRaises(StopIteration):
            next(tokens)
Check AnsiTerminalParser ignores unknown codes.
tests/test_parsers.py