2 Test behavior of `po` and persistent results.
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
.decorators
import *
8 from lldbsuite
.test
import lldbutil
11 class TestCase(TestBase
):
15 lldbutil
.run_to_source_breakpoint(self
, "break here", lldb
.SBFileSpec("main.m"))
18 def test_po_does_not_print_persistent_result(self
):
19 """Test `po` doesn't advertise a persistent result variable."""
20 self
.expect("po obj", matching
=False, substrs
=["$0 = "])
23 def test_po_does_not_keep_persistent_result(self
):
24 """Test `po` doesn't leak a persistent result variable."""
26 # Verify `po` used a temporary persistent result. In other words, there
27 # should be no $0 at this point.
28 self
.expect("expression $0", error
=True)
29 self
.expect("expression obj", substrs
=["$0 = "])
32 def test_expression_description_verbosity(self
):
33 """Test printing object description _and_ opt-in to persistent results."""
34 self
.expect("expression -O -vfull -- obj", substrs
=["$0 = "])
35 self
.expect("expression $0", substrs
=["$0 = "])