Fix the hunk_roundtrip test, simplify code, improve test coverage, fix some edge cases.

Created by  FHRXP5Jnb2MWLDrPrnLnkN2ryWcGCo6CRr1dXR9FW2YA  on December 9, 2021
YQMLICLW2FABJBX5AQGPZIHICYLECR53TLPEBGUEH23YNKIMKC7AC
Change contents