[Lldb-commits] [lldb] [lldb][windows] add unit tests for the StripConPTYSequences method (PR #194654)

via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 28 08:13:51 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- lldb/include/lldb/Host/windows/ConPTYUtils.h lldb/source/Host/common/ConPTYUtils.cpp lldb/unittests/Host/StripConPTYSequencesTest.cpp lldb/include/lldb/Host/windows/ConnectionConPTYWindows.h lldb/source/Host/windows/ConnectionConPTYWindows.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Host/windows/ConnectionConPTYWindows.cpp b/lldb/source/Host/windows/ConnectionConPTYWindows.cpp
index ddbfbbc59..d370aa7a7 100644
--- a/lldb/source/Host/windows/ConnectionConPTYWindows.cpp
+++ b/lldb/source/Host/windows/ConnectionConPTYWindows.cpp
@@ -15,7 +15,6 @@
 using namespace lldb;
 using namespace lldb_private;
 
-
 ConnectionConPTY::ConnectionConPTY(std::shared_ptr<PseudoConsole> pty)
     : ConnectionGenericFile(pty->GetSTDOUTHandle(), false), m_pty(pty) {}
 
diff --git a/lldb/unittests/Host/StripConPTYSequencesTest.cpp b/lldb/unittests/Host/StripConPTYSequencesTest.cpp
index ad91b2636..1796f43d3 100644
--- a/lldb/unittests/Host/StripConPTYSequencesTest.cpp
+++ b/lldb/unittests/Host/StripConPTYSequencesTest.cpp
@@ -1,4 +1,5 @@
-//===-- StripConPTYSequencesTest.cpp ---------------------------------------===//
+//===-- StripConPTYSequencesTest.cpp
+//---------------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -28,9 +29,7 @@ TEST(StripConPTYSequencesTest, PassthroughPlainText) {
   EXPECT_EQ("Hello World!\r\n", Strip("Hello World!\r\n", true));
 }
 
-TEST(StripConPTYSequencesTest, EmptyInput) {
-  EXPECT_EQ("", Strip("", true));
-}
+TEST(StripConPTYSequencesTest, EmptyInput) { EXPECT_EQ("", Strip("", true)); }
 
 TEST(StripConPTYSequencesTest, StripCursorQuery) {
   EXPECT_EQ("", Strip("\x1b[6n", true));
@@ -54,7 +53,9 @@ TEST(StripConPTYSequencesTest, StripFocusEvents) {
 TEST(StripConPTYSequencesTest, StripWindowTitle) {
   EXPECT_EQ("", Strip("\x1b]0;My Title\x07", true));
   EXPECT_EQ("abc", Strip("abc\x1b]0;window\x07", true));
-  EXPECT_EQ("abc", Strip("\x1b]0;title\x07" "abc", true));
+  EXPECT_EQ("abc", Strip("\x1b]0;title\x07"
+                         "abc",
+                         true));
 }
 
 TEST(StripConPTYSequencesTest, WindowTitleWithoutBEL) {
@@ -91,12 +92,12 @@ TEST(StripConPTYSequencesTest, PreserveUnrecognizedEscape) {
 
 TEST(StripConPTYSequencesTest, TypicalConPTYInitBurst) {
   // Simulates the first read from ConPTY with PSEUDOCONSOLE_INHERIT_CURSOR.
-  std::string init = "\x1b[6n"           // cursor query
-                     "\x1b[?9001h"       // Win32 Input Mode on
-                     "\x1b[?1004h"       // focus events on
-                     "\x1b[m"            // SGR reset
+  std::string init = "\x1b[6n"            // cursor query
+                     "\x1b[?9001h"        // Win32 Input Mode on
+                     "\x1b[?1004h"        // focus events on
+                     "\x1b[m"             // SGR reset
                      "\x1b]0;C:\\app\x07" // window title
-                     "\x1b[?25h";        // show cursor
+                     "\x1b[?25h";         // show cursor
   EXPECT_EQ("", Strip(init, true));
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/194654


More information about the lldb-commits mailing list