From 165c1240a9e0f6364643cf2933e4dcc05c4a637f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Feb 2022 11:04:12 +0530 Subject: [PATCH] Make the test a little more robust --- kitty_tests/shell_integration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty_tests/shell_integration.py b/kitty_tests/shell_integration.py index 0758b2d25..8c398a611 100644 --- a/kitty_tests/shell_integration.py +++ b/kitty_tests/shell_integration.py @@ -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(