Commit 95b51ab5

95b51ab5502aMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 2 files · +1 added · ~1 modified

Description

fix(test): normalize CRLF when reading .expected, force LF eol attribute

The previous commit's per-test recipe cp-ed test/.rb.expected verbatim. On Windows, git's autocrlf default converted those LF files to CRLF on checkout, so the comparison against the spinel binary's LF stdout failed for every test on the windows-mingw job.

Two-part fix:

  1. Run the same LC_ALL=C sed 's/\r$//' pass on .expected that the spinel actual output goes through, so checkout-time line ending conversion is harmless.
  2. Add .gitattributes pinning .expected files to LF so this doesn't bite tools that don't normalize (e.g. an editor that strips trailing whitespace and saves CRLF in the same pass).

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
95b51ab5502a
Parent
9dcf064f5b49

.gitattributesaddedView file

1+# Keep test expected outputs LF on every platform — they're compared
2+# against spinel binary stdout, which always produces LF, after a
3+# sed/CRLF strip pass on both sides.
4+test/*.rb.expected text eol=lf