From 06bd1e9347dd0ea1abd589a9dbca9f9112d5fc65 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 14 Oct 2020 19:26:13 +0200 Subject: [PATCH] tests: Check that ctrl-z can be bound We've heard news of this regressing, so let's add the test that should have been there already (mea culpa!). Because we now use POSIX_VDISABLE, this should also work in tandem with ctrl-space (which sends NUL), but we can't test *that* because some systems might not have POSIX_VDISABLE. --- tests/pexpects/bind.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/pexpects/bind.py b/tests/pexpects/bind.py index c7d4d8612..70fd3c49b 100644 --- a/tests/pexpects/bind.py +++ b/tests/pexpects/bind.py @@ -2,7 +2,14 @@ from pexpect_helper import SpawnedProc sp = SpawnedProc() -send, sendline, sleep, expect_prompt = sp.send, sp.sendline, sp.sleep, sp.expect_prompt +send, sendline, sleep, expect_prompt, expect_re, expect_str = ( + sp.send, + sp.sendline, + sp.sleep, + sp.expect_prompt, + sp.expect_re, + sp.expect_str, +) expect_prompt() # Clear twice (regression test for #7280). @@ -289,3 +296,9 @@ send(" a b c d\x01") # ctrl-a, move back to the beginning of the line send("\x07") # ctrl-g, kill bigword sendline("echo") expect_prompt("\nb c d") + +# Check that ctrl-z can be bound +sendline('bind \cz "echo bound ctrl-z"') +expect_prompt() +send('\x1A') +expect_str("bound ctrl-z")