bpo-42426: IDLE: Fix reporting offset of the RE error in searchengine (GH-23447)

This commit is contained in:
Serhiy Storchaka 2020-11-22 07:06:51 +02:00 committed by GitHub
parent 442746af64
commit 453bc1da20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 9 deletions

View file

@ -175,11 +175,13 @@ class SearchEngineTest(unittest.TestCase):
engine.setpat('')
Equal(engine.getprog(), None)
Equal(Mbox.showerror.message,
'Error: Empty regular expression')
engine.setpat('+')
engine.revar.set(1)
Equal(engine.getprog(), None)
self.assertEqual(Mbox.showerror.message,
'Error: nothing to repeat at position 0\nPattern: +')
Equal(Mbox.showerror.message,
'Error: nothing to repeat\nPattern: +\nOffset: 0')
def test_report_error(self):
showerror = Mbox.showerror