This adds several 5C/5D escape codes that allow moving forward/backward words similar to bash command line navigation.
On my terminal, ctrl+v ctrl+<left arrow> prints ^[[1;5D. However, it seems inputrc also maps other escape variants of this to forward/backward word, so I've included those too. Similar for 5C = ctrl+right arrow.
There are several reasons why doing that doesn't work well. The first is that the "console" output would differ depending on whether lldb/libedit has had a chance to disable echo or not. Assuming you got past that, the second problem would be that the output would contain a lot of ansi cursor movement escape sequences, and redraws, and you'd have to encode in the test the exact way in which libedit chose to implement the line editing operations. Checking for the effect of the command indeed seems like the best way to exercise this functionality.