I noticed that pg_resetwal has poor test coverage. There are some TAP
tests, but they all run with -n, so they don't actually test the full
functionality. (There is a non-dry-run call of pg_resetwal in the
recovery test suite, but that is incidental.)
So I added a bunch of more tests to test all the different options and
scenarios. That also led to adding more documentation about more
details how some of the options behave, and some tweaks in the program
output.
It's attached as one big patch, but it could be split into smaller
pieces, depending what gets agreement.