[Lldb-commits] [lldb] [lldb][test] TestExprCompletion.py: add tests for completion of reserved identifiers (PR #84890)
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 12 03:06:03 PDT 2024
https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/84890
None
>From ecb8e2744628207dd0ec72272428e3f57e8d68bb Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Tue, 12 Mar 2024 10:04:12 +0000
Subject: [PATCH] [lldb][test] TestExprCompletion.py: add tests for completion
of reserved identifiers
---
.../expression/completion/TestExprCompletion.py | 14 ++++++++++++++
.../API/commands/expression/completion/main.cpp | 11 +++++++++++
2 files changed, 25 insertions(+)
diff --git a/lldb/test/API/commands/expression/completion/TestExprCompletion.py b/lldb/test/API/commands/expression/completion/TestExprCompletion.py
index c6a1e3c0f42275..d322b9c323d1ef 100644
--- a/lldb/test/API/commands/expression/completion/TestExprCompletion.py
+++ b/lldb/test/API/commands/expression/completion/TestExprCompletion.py
@@ -246,6 +246,20 @@ def test_expr_completion(self):
"expr some_expr.Self(). FooNoArgs", "expr some_expr.Self(). FooNoArgsBar()"
)
+ self.complete_from_to(
+ "expr myVec.__f", "expr myVec.__func()"
+ )
+ self.complete_from_to(
+ "expr myVec._F", "expr myVec._Func()"
+ )
+ self.complete_from_to(
+ "expr myVec.__m", "expr myVec.__mem"
+ )
+ self.complete_from_to(
+ "expr myVec._M", "expr myVec._Mem"
+ )
+
+
def test_expr_completion_with_descriptions(self):
self.build()
self.main_source = "main.cpp"
diff --git a/lldb/test/API/commands/expression/completion/main.cpp b/lldb/test/API/commands/expression/completion/main.cpp
index 908bebbebff568..b87f9626c93283 100644
--- a/lldb/test/API/commands/expression/completion/main.cpp
+++ b/lldb/test/API/commands/expression/completion/main.cpp
@@ -1,3 +1,11 @@
+class MyVec {
+ int __mem;
+ int _Mem;
+public:
+ void __func() {}
+ void _Func() {}
+};
+
namespace LongNamespaceName { class NestedClass { long m; }; }
// Defined in other.cpp, we only have a forward declaration here.
@@ -31,5 +39,8 @@ int main()
some_expr.FooNumbersBar1();
Expr::StaticMemberMethodBar();
ForwardDecl *fwd_decl_ptr = &fwd_decl;
+ MyVec myVec;
+ myVec.__func();
+ myVec._Func();
return 0; // Break here
}
More information about the lldb-commits
mailing list