Improve parser error messages a bit

This commit is contained in:
Kovid Goyal
2021-05-17 21:29:54 +05:30
parent 07b643e24c
commit 4d0d0b205d
2 changed files with 15 additions and 7 deletions

View File

@@ -100,9 +100,9 @@ class TestParser(BaseTest):
s.cursor_back(5)
pb('x\033[2@y', 'x', ('screen_insert_characters', 2), 'y')
self.ae(str(s.line(0)), 'xy bc')
pb('x\033[2;7@y', 'x', ('CSI code 0x40 has 2 > 1 parameters',), 'y')
pb('x\033[2;-7@y', 'x', ('CSI code 0x40 has 2 > 1 parameters',), 'y')
pb('x\033[-2@y', 'x', ('CSI code 0x40 is not allowed to have negative parameter (-2)',), 'y')
pb('x\033[2;7@y', 'x', ('CSI code @ has 2 > 1 parameters',), 'y')
pb('x\033[2;-7@y', 'x', ('CSI code @ has 2 > 1 parameters',), 'y')
pb('x\033[-2@y', 'x', ('CSI code @ is not allowed to have negative parameter (-2)',), 'y')
pb('x\033[2-3@y', 'x', ('CSI code can contain hyphens only at the start of numbers',), 'y')
pb('x\033[@y', 'x', ('screen_insert_characters', 1), 'y')
pb('x\033[345@y', 'x', ('screen_insert_characters', 345), 'y')