Use diff's --strip-trailing-cr flag where appropriate on Windows
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 10 Jul 2024 13:53:47 +0000 (09:53 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 10 Jul 2024 14:05:00 +0000 (10:05 -0400)
commit4506d18a9891c70ce977047e2b4ffc05bef65165
tree7cf48e3e440c6e82dc0532805160aa5e98495154
parent0248762b2a8e5c825ab845797aa14647c74be166
Use diff's --strip-trailing-cr flag where appropriate on Windows

Test result files might be checked out using Unix or Windows style line
endings, depening on git flags, so on Windows we use the
--strip-trailing-cr flag to tell diff to ignore line endings
differences.

The flag is added to the diff invocation for the test_json_parser module
tests and the pg_bsd_indent tests. in pg_regress.c we replace the
current use of the "-w" flag, which ignore all white space differences,
with this one which only ignores line end differences.

Discussion: https://postgr.es/m/20240707052030.r77hbdkid3mwksop@awork3.anarazel.de
src/test/modules/test_json_parser/t/003_test_semantic.pl
src/test/regress/pg_regress.c
src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl