[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 23 02:42:29 PDT 2020


labath added a comment.

Some quibbles about the test. Otherwise, this looks good to me.



================
Comment at: lldb/test/API/iohandler/autosuggestion/TestAutosuggestion.py:33
+        self.child.send("hel")
+        self.child.expect_exact(faint_color + "p frame" + reset + "\x1b[1G")
+        
----------------
`[1G` means move the cursor to the first column, which is not what we have wanted to test here. My guess is that this `1G` is the start of the sequence that libedit uses to redraw the prompt (or the entire command line). If that's the case (and we are serious about testing the cursor position), then I guess you'll need to expect that entire sequence. Or possibly, split this into two `expect_exact` calls so that the second call just checks for the presence of the final sequence which actually puts the cursor in the right place.


================
Comment at: lldb/test/API/iohandler/autosuggestion/TestAutosuggestion.py:52
+        self.child.send(ctrl_f)
+        self.child.expect_exact("")
+        self.child.send("\n")
----------------
This won't check anything because an empty string is "everywhere". I thing the best we can do right now is  type some more text after the ^F, and then check that _that_ text is executed properly (i.e., that it didn't get appended to some other command).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81001/new/

https://reviews.llvm.org/D81001





More information about the lldb-commits mailing list