I wrapped the repeated test infrastructure in a `vitest` function and inlined the dozens of tiny input files.
I shortened some of the test inputs to be clearer and discovered a couple bugs, left for now as commented out tests:
* `b` movement is off by one.
* Deleting/moving the last part of the last line of the file is off by one, usually leaving the final character in place.
The array of section flags was missing the G flag, so any flags
after it were displayed incorrectly. And, of course, the G flag
was not displayed at all.
Added a new elf file with a section that include the T and C flags
and updated readelf.test to run this test. This test fails on the
old code and passes with the fix.
Fixed delete last word test. (script should not have \n since it is
cursor down in vim)
Added tests to check inserts
Added tests to check yank and push
Test file integrity after load, move, delete and save+exit. Drawing
of buffer is not tested yet.
Added -s script option, accept file that is run as startup script of
commands. File is parsed byte at time and handled as you had typed it.
If EOF has been reached without editor close command, editing is
continued normally using keyboard. This functionality is in vim and
neovim, but not in POSIX vi standard. nvi (vi used in some macs) has
-s with different meaning...
Some simple tests added, dw last line test fails, so test is disabled.
We keep regressing on this, and the ELF stuff is quite complicated, so
even though checking in binaries isn't my first choice, this seems like
a good use of 20KiB...
I'm switching to a new laptop, and found this from 2017-07. I think
these are the tests used for the Android libziparchive-based unzip.
They pass on the host.