Skip to content

Commit 6712528

Browse files
committed
gh-150922: Fix test_cmd libedit assertion in test_bang_completion_without_do_shell
GNU readline retypes the full completed word after tab completion, but libedit redraws only the untyped suffix following a cursor-forward escape sequence. Assert on the common suffix ('ello') instead of the literal 'hello' bytes so the test passes on both backends.
1 parent f81c03a commit 6712528

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/test/test_cmd.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ def default(self, line):
316316
for input in [b"! h\t\n", b"!h\t\n"]:
317317
with self.subTest(input=input):
318318
output = run_pty(script, input)
319-
self.assertIn(b'hello', output)
319+
# libedit redraws only the untyped suffix after a
320+
# cursor-forward escape, unlike GNU readline which retypes
321+
# the whole completed word, so check the common suffix.
322+
self.assertIn(b'ello', output)
320323
self.assertIn(b'tab completion success', output)
321324

322325
def load_tests(loader, tests, pattern):

0 commit comments

Comments
 (0)