Hmm, maybe. That's why I added the "text editor" suffix to the title, to be specific about what I was referring to. "Interactive command-line app" could also be misinterpreted because any CLI that asks for user input on a line-oriented manner (e.g. a REPL) would qualify, right?
Another way to disambiguate TUIs vs CLIs is to refer to the frameworks used to develop the app. For instance, mentioning ncurses or ncurses-based app is also frequently used to refer to TUIs.
As it's pretty vital information I don't think it belongs in a subheading, which may be chopped when the post is submitted to a site like HN.
> any CLI that asks for user input on a line-oriented manner (e.g. a REPL) would qualify, right?
That's true, but it's more specific than console app. It would be a bit cumbersome to restate what TUI means in less obscure terms, although it wouldn't be the longest title known to man: Unit-testing a full-screen interactive command-line application.
These ideas are exactly what I have been looking for. A year or so ago I started working on a prototype tool[0] using `curses` and I never found a good way to test things beyond behavior of internal methods.
In an effort to make it more portable I have started a re-write[1] in Rust (using `crossterm` this time). This mocking strategy seems like exactly what I need to fix this gap in the app's tests.
Glad to hear that you liked the post and that you'll try it in a project of yours! It'd be nice to hear about your experience later on. crossterm is a very nice library, and I suspect it'd be extended somehow to "natively" support the kind of mocking I presented in the post without having to add an intermediate abstraction layer.
I use something similar for snapshot testing in Go. It's been really useful for regression testing for anything that can be serialized to []byte. I've used it for CLI output and testing image processing.
For the Logfile Navigator (https://lnav.org), I implemented a tool[0] to record console input/output and then replay the input while verifying the output. It basically works, but needs some usability improvement. For example, the expected output is the raw escape sequences, so it's hard to look at a diff and see what really happened. I think it can be improved, I just haven't found the time yet.