mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-110944: Make pdb completion work for alias and convenience vars (GH-110945)
This commit is contained in:
parent
324531df90
commit
f44d6ff6e0
3 changed files with 39 additions and 1 deletions
|
@ -3289,6 +3289,27 @@ class PdbTestReadline(unittest.TestCase):
|
|||
self.assertIn(b'continue', output)
|
||||
self.assertIn(b'hello!', output)
|
||||
|
||||
def test_expression_completion(self):
|
||||
script = textwrap.dedent("""
|
||||
value = "speci"
|
||||
import pdb; pdb.Pdb().set_trace()
|
||||
""")
|
||||
|
||||
# Complete: value + 'al'
|
||||
input = b"val\t + 'al'\n"
|
||||
# Complete: p value + 'es'
|
||||
input += b"p val\t + 'es'\n"
|
||||
# Complete: $_frame
|
||||
input += b"$_fra\t\n"
|
||||
# Continue
|
||||
input += b"c\n"
|
||||
|
||||
output = run_pty(script, input)
|
||||
|
||||
self.assertIn(b'special', output)
|
||||
self.assertIn(b'species', output)
|
||||
self.assertIn(b'$_frame', output)
|
||||
|
||||
|
||||
def load_tests(loader, tests, pattern):
|
||||
from test import test_pdb
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue