[clang] Add tracking source deduction guide for the explicitly-written
[llvm-project.git] / lldb / test / API / lang / cpp / fixits / TestCppFixIts.py
blob34b52f796da28beaee306e4132faccf321fba891
1 """
2 Tests a C++ fixit for the `expr` command and
3 `po` alias (aka DWIM aka "do what I mean") alias.
4 """
5 import lldb
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)."""
15 self.build()
16 lldbutil.run_to_source_breakpoint(
17 self, "// break here", lldb.SBFileSpec("main.cpp")
20 self.expect(
21 "dwim-print -O -- class C { int i; void f() { []() { ++i; }(); } }; 42",
22 error=True,
23 substrs=[
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)."""
32 self.build()
33 lldbutil.run_to_source_breakpoint(
34 self, "// break here", lldb.SBFileSpec("main.cpp")
37 self.expect(
38 "expr class C { int i; void f() { []() { ++i; }(); } }; 42",
39 error=True,
40 substrs=[
41 "Evaluated this expression after applying Fix-It(s)",
42 "class C { int i; void f() { [this]() { ++i; }(); } }",