9b2b71230e52e88c3cda4589b0b7d38230f86ee5
[openbsd] /
1 """
2 Test completion for multiline expressions.
3 """
4
5 import lldb
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test.lldbpexpect import PExpectTest
9
10 class MultilineCompletionTest(PExpectTest):
11
12     mydir = TestBase.compute_mydir(__file__)
13
14     # PExpect uses many timeouts internally and doesn't play well
15     # under ASAN on a loaded machine..
16     @skipIfAsan
17     @skipIfRemote  # test is written to explicitly "run" the binary
18     @skipIfEditlineSupportMissing
19     def test_basic_completion(self):
20         """Test that we can complete a simple multiline expression"""
21         self.build()
22
23         self.launch(executable=self.getBuildArtifact("a.out"), dimensions=(100,500))
24         self.expect("b main", substrs=["Breakpoint 1", "address ="])
25         self.expect("run", substrs=["stop reason ="])
26
27         self.child.sendline("expr")
28         self.child.expect_exact("terminate with an empty line to evaluate")
29         self.child.send("to_\t")
30         self.child.expect_exact("to_complete")
31
32         self.child.send("\n\n")
33         self.expect_prompt()
34
35         self.quit()