diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2023-11-14 12:22:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 12:22:25 (GMT) |
commit | f44d6ff6e0c9eeb0bb246a3dd8f99d40b7050054 (patch) | |
tree | af2ac4ad4871eaf0047b1e48f8e593a9993154f4 /Lib/test | |
parent | 324531df909721978446d504186738a33ab03fd5 (diff) | |
download | cpython-f44d6ff6e0c9eeb0bb246a3dd8f99d40b7050054.zip cpython-f44d6ff6e0c9eeb0bb246a3dd8f99d40b7050054.tar.gz cpython-f44d6ff6e0c9eeb0bb246a3dd8f99d40b7050054.tar.bz2 |
gh-110944: Make pdb completion work for alias and convenience vars (GH-110945)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_pdb.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 2ec4e2e..67a4053 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -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 |