~razzi/editor-testing

Update to my fork of headlessvim
New approach using tmux

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~razzi/editor-testing
read/write
git@git.sr.ht:~razzi/editor-testing

You can also use your local clone with git send-email.

#editor-testing

I've configured and reconfigured vim and emacs, and I find myself breaking features I had implemented previously. Unit testing is possible, but most configuration is tested interactively.

editor-testing allows you to drive a command line editor programmatically to test its functionality.

Once you've described a set of actions (keybindings) and a desire end state, you can use this in other configurations and even other editors, since they all have the same basic stdin input scheme.

Use cases:

  • Writing integration tests for a given configuration of an editor
  • Comparing features across editors / config distributions
  • Documenting how an editor is intended to function

#Examples

\cX = control-x \e = escape \r = enter

TODO: making nice aliases for these control characters.

python3 run_editor.py vim ihello\e:wq\r

python3 run_editor.py nano hello\cXy\r

#TODO

TODO: emacs isn't working:

python3 run_editor.py emacs hello\cX\cS\cX\cC

reports editor has not exited.

Another TODO: config isolation

Maybe this whole thing could be driven by tmux, which would handle the environment more automatically. There are pros a cons to this approach. Worth a try.