test/chain-wrap: abstracted equivalence-testing pattern