t0001: use test_cmp instead of 'diff -u'

Signed-off-by: John Keeping <john@keeping.me.uk>
tests: use test_line_count where appropriate

This gets us better output when the line count is incorrect, which will
help debugging test failures.

Signed-off-by: John Keeping <john@keeping.me.uk>