Is it possible to automate testing user input?
An example of this could be multiple editing operations, undo, saving, reverting the buffer etc. Then checking the buffer contents is what the test expects.
The user input could be keyboard shortcuts or (preferably) commands run as if they were bound to keys.
Hooks should run as would typically happen when running interactive commands, so the last-command
, variable should be set, post-command-hook
should run. etc.
To make this question concrete, is it possible to type 5 lines, undo 4, redo 2 times, then ensure 3 of the 5 lines were entered?