1"""
2Test completion for multiline expressions.
3"""
4
5import lldb
6from lldbsuite.test.decorators import *
7from lldbsuite.test.lldbtest import *
8from lldbsuite.test.lldbpexpect import PExpectTest
9
10class 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    @skipIfEditlineSupportMissing
18    def test_basic_completion(self):
19        """Test that we can complete a simple multiline expression"""
20        self.build()
21
22        self.launch(executable=self.getBuildArtifact("a.out"), dimensions=(100,500))
23        self.expect("b main", substrs=["Breakpoint 1", "address ="])
24        self.expect("run", substrs=["stop reason ="])
25
26        self.child.sendline("expr")
27        self.child.expect_exact("terminate with an empty line to evaluate")
28        self.child.send("to_\t")
29        self.child.expect_exact("to_complete")
30
31        self.child.send("\n\n")
32        self.expect_prompt()
33
34        self.quit()
35