]> git.ipfire.org Git - thirdparty/curl.git/commit
tests/data: support using native newlines on disk, drop `.gitattributes`
authorViktor Szakats <commit@vsz.me>
Fri, 7 Nov 2025 15:39:29 +0000 (16:39 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 10 Nov 2025 13:21:34 +0000 (14:21 +0100)
commitf477f3efc3ec58f7effc2aa01e7f4565b12be976
tree0a615e3e5f5dccd392b415b66cd8223add074cb3
parent8e321a53df866dfb2a2d5c5fc77c9639f733f93f
tests/data: support using native newlines on disk, drop `.gitattributes`

Data files no longer depend on mixed newline styles. Before this
patch the harness still assumed data files to use LF newlines,
ensured by `.gitattribute` and distributing sources with LF newlines.

To allow using platform native newlines (CRLF on Windows typically),
update the test harness to support data files with any newline style
on disk. And delete `.gitattributes`.

Fix to:
- load original data files (from test/data) so that their newline-style
  doesn't matter on the checked out source repo, meaning it works
  when its CRLF on Windows, just like any other file.
  (if a BOM slips in, it's caught by `spacecheck.pl` as binary content.)
- do the same in `util.py` used by `smbserver.py` (for test 1451).
- also fix `util.py` to use us-ascii encoding for data files, replacing utf-8.

Also:
- runtests: rework the stray CR checker to allow full CRLF data files,
  and keep warning for mixed newlines.

Follow-up to 904e7ecb66519951681377758fe6b07dde28ce36 #19347

Closes #19398
tests/data/.gitattributes [deleted file]
tests/devtest.pl
tests/getpart.pm
tests/runner.pm
tests/runtests.pl
tests/util.py