jessicah updated this revision to Diff 107623.
jessicah added a comment.

A test case was added.


https://reviews.llvm.org/D35525

Files:
  packages/Python/lldbsuite/test/help/TestHelp.py
  source/Interpreter/CommandInterpreter.cpp


Index: source/Interpreter/CommandInterpreter.cpp
===================================================================
--- source/Interpreter/CommandInterpreter.cpp
+++ source/Interpreter/CommandInterpreter.cpp
@@ -2569,7 +2569,7 @@
 
   while (!text.empty()) {
     if (text.front() == '\n' ||
-        (text.front() == ' ' && nextWordLength(text.ltrim(' ')) < chars_left)) 
{
+        (text.front() == ' ' && nextWordLength(text.ltrim(' ')) > chars_left)) 
{
       strm.EOL();
       strm.Indent();
       chars_left = max_columns - indent_size;
Index: packages/Python/lldbsuite/test/help/TestHelp.py
===================================================================
--- packages/Python/lldbsuite/test/help/TestHelp.py
+++ packages/Python/lldbsuite/test/help/TestHelp.py
@@ -230,3 +230,12 @@
             'command alias --long-help "I am a very friendly alias" -- 
averyfriendlyalias help')
         self.expect("help averyfriendlyalias", matching=True,
                     substrs=['I am a very friendly alias'])
+    @no_debug_info_test
+    def test_help_format_output(self):
+        """Test that help output reaches TerminalWidth."""
+        self.runCmd(
+            'settings set term-width 108')
+        self.expect(
+            "help format",
+            matching=True,
+            substrs=['<format> -- One of the format names'])


Index: source/Interpreter/CommandInterpreter.cpp
===================================================================
--- source/Interpreter/CommandInterpreter.cpp
+++ source/Interpreter/CommandInterpreter.cpp
@@ -2569,7 +2569,7 @@
 
   while (!text.empty()) {
     if (text.front() == '\n' ||
-        (text.front() == ' ' && nextWordLength(text.ltrim(' ')) < chars_left)) {
+        (text.front() == ' ' && nextWordLength(text.ltrim(' ')) > chars_left)) {
       strm.EOL();
       strm.Indent();
       chars_left = max_columns - indent_size;
Index: packages/Python/lldbsuite/test/help/TestHelp.py
===================================================================
--- packages/Python/lldbsuite/test/help/TestHelp.py
+++ packages/Python/lldbsuite/test/help/TestHelp.py
@@ -230,3 +230,12 @@
             'command alias --long-help "I am a very friendly alias" -- averyfriendlyalias help')
         self.expect("help averyfriendlyalias", matching=True,
                     substrs=['I am a very friendly alias'])
+    @no_debug_info_test
+    def test_help_format_output(self):
+        """Test that help output reaches TerminalWidth."""
+        self.runCmd(
+            'settings set term-width 108')
+        self.expect(
+            "help format",
+            matching=True,
+            substrs=['<format> -- One of the format names'])
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to