Add test for HISTFILE

This commit is contained in:
Kovid Goyal 2022-02-28 20:09:54 +05:30
parent 1f6a4f7bd4
commit e103b280fd
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -278,6 +278,8 @@ PS1="{ps1}"
pty.send_cmd_to_child('printf "%s\x16\a%s" "a" "b"') pty.send_cmd_to_child('printf "%s\x16\a%s" "a" "b"')
pty.wait_till(lambda: pty.screen_contents().count(ps1) == 2) pty.wait_till(lambda: pty.screen_contents().count(ps1) == 2)
self.ae(pty.screen_contents(), f'{ps1}printf "%s^G%s" "a" "b"\nab{ps1}') self.ae(pty.screen_contents(), f'{ps1}printf "%s^G%s" "a" "b"\nab{ps1}')
pty.send_cmd_to_child('echo $HISTFILE')
pty.wait_till(lambda: '.bash_history' in pty.screen_contents())
for ps1 in ('line1\\nline\\2\\prompt> ', 'line1\nprompt> ', 'line1\\nprompt> ',): for ps1 in ('line1\\nline\\2\\prompt> ', 'line1\nprompt> ', 'line1\\nprompt> ',):
with self.subTest(ps1=ps1), self.run_shell( with self.subTest(ps1=ps1), self.run_shell(