diff --git a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py --- a/lldb/packages/Python/lldbsuite/test/lldbpexpect.py +++ b/lldb/packages/Python/lldbsuite/test/lldbpexpect.py @@ -50,6 +50,7 @@ self.expect_prompt() def expect(self, cmd, substrs=None): + self.assertNotIn('\n', cmd) self.child.sendline(cmd) if substrs is not None: for s in substrs: diff --git a/lldb/packages/Python/lldbsuite/test/terminal/TestEditline.py b/lldb/packages/Python/lldbsuite/test/terminal/TestEditline.py --- a/lldb/packages/Python/lldbsuite/test/terminal/TestEditline.py +++ b/lldb/packages/Python/lldbsuite/test/terminal/TestEditline.py @@ -34,16 +34,13 @@ """ self.launch() - # Run help for different commands for escape variants to make sure each - # one matches uniquely (the buffer isn't cleared in between matches). - cases = [ - ("print", "\x1b[1;5D", "\x1b[1;5C"), - ("step", "\x1b[5D", "\x1b[5C"), - ("exit", "\x1b\x1b[D", "\x1b\x1b[C"), + escape_pairs = [ + ("\x1b[1;5D", "\x1b[1;5C"), + ("\x1b[5D", "\x1b[5C"), + ("\x1b\x1b[D", "\x1b\x1b[C"), ] - for (cmd, l_escape, r_escape) in cases: - self.expect("el {cmd_tail}{L}{cmd_head}{L}{L}h{R}p".format( - cmd_head=cmd[0], cmd_tail=cmd[1:], L=l_escape, R=r_escape), - substrs=["Syntax: %s" % cmd]) + for (l_escape, r_escape) in escape_pairs: + self.expect("el rint{L}p{L}{L}h{R}p".format( + L=l_escape, R=r_escape), substrs=["Syntax: print"]) self.quit()