Ensure that supported control sequences are parsed successfully.
(self)
| 31 | self.assertEqual(parse_keys(test_key), expected_keys) |
| 32 | |
| 33 | def test_control_sequences(self): |
| 34 | """Ensure that supported control sequences are parsed successfully.""" |
| 35 | keys = ["@", "[", "]", "\\", "^", "_", "\\<space>", "\\<delete>"] |
| 36 | keys.extend(string.ascii_letters) |
| 37 | test_cases = [(f"\\C-{key}", chr(ord(key) & 0x1F)) for key in []] |
| 38 | for test_key, expected_keys in test_cases: |
| 39 | with self.subTest(f"{test_key} should be parsed as {expected_keys}"): |
| 40 | self.assertEqual(parse_keys(test_key), expected_keys) |
| 41 | |
| 42 | def test_meta_sequences(self): |
| 43 | self.assertEqual(parse_keys("\\M-a"), ["\033", "a"]) |
nothing calls this directly
no test coverage detected