2 Tests a C++ fixit for the `expr` command and
3 `po` alias (aka DWIM aka "do what I mean") alias.
6 from lldbsuite
.test
.decorators
import *
7 from lldbsuite
.test
.lldbtest
import *
8 from lldbsuite
.test
import lldbutil
11 class TestCase(TestBase
):
12 def test_fixit_with_dwim(self
):
13 """Confirms `po` shows an expression after applying Fix-It(s)."""
16 lldbutil
.run_to_source_breakpoint(
17 self
, "// break here", lldb
.SBFileSpec("main.cpp")
21 "dwim-print -O -- class C { int i; void f() { []() { ++i; }(); } }; 42",
24 "Evaluated this expression after applying Fix-It(s)",
25 "class C { int i; void f() { [this]() { ++i; }(); } }",
29 def test_fixit_with_expression(self
):
30 """Confirms `expression` shows an expression after applying Fix-It(s)."""
33 lldbutil
.run_to_source_breakpoint(
34 self
, "// break here", lldb
.SBFileSpec("main.cpp")
38 "expr class C { int i; void f() { []() { ++i; }(); } }; 42",
41 "Evaluated this expression after applying Fix-It(s)",
42 "class C { int i; void f() { [this]() { ++i; }(); } }",