tests: use test_cmp instead of piping to diff(1)