]> git.ipfire.org Git - thirdparty/git.git/commit
t1006: modernize test style to use `test_cmp`
authorPatrick Steinhardt <ps@pks.im>
Tue, 6 Jun 2023 05:19:33 +0000 (07:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jun 2023 20:23:24 +0000 (13:23 -0700)
commitb116c77307853a9fa8f74d1ad16bed98a7211207
tree512fcce72a1e8635e652dedf278e3b079fcb88ef
parentc7309f63c606cebd4dea8b2a31e5ffbb2e2bf205
t1006: modernize test style to use `test_cmp`

The tests for git-cat-file(1) are quite old and haven't ever been
updated since they were introduced. They thus tend to use old idioms
that have since grown outdated. Most importantly, many of the tests use
`test $A = $B` to compare expected and actual output. This has the
downside that it is impossible to tell what exactly is different between
both versions in case the test fails.

Refactor the tests to instead use `test_cmp`. While more verbose, it
both tends to be more readable and will result in a nice diff in case
states don't match.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1006-cat-file.sh