Make the test a little more robust

This commit is contained in:
Kovid Goyal 2022-02-27 11:04:12 +05:30
parent ef5c66ee17
commit 165c1240a9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -277,8 +277,8 @@ PS1="{ps1}"
with self.run_shell(shell='bash', rc=f'''PS1="{ps1}"''') as pty:
pty.callbacks.clear()
pty.send_cmd_to_child('printf "%s\x16\a%s" "a" "b"')
pty.wait_till(lambda: 'ab' in pty.screen_contents())
self.ae(pty.screen_contents(), 'prompt> printf "%s^G%s" "a" "b"\nab')
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}')
for ps1 in ('line1\\nline\\2\\prompt> ', 'line1\nprompt> ', 'line1\\nprompt> ',):
with self.subTest(ps1=ps1), self.run_shell(