sandersn / mini-typescript

A miniature model of the Typescript compiler, intended to teach the structure of the real Typescript compiler
MIT License
1.14k stars 61 forks source link

Test failures due to EOL conversion on Windows #5

Closed morzel85 closed 3 years ago

morzel85 commented 3 years ago

It is likely that Git on Windows applies EOL conversion from LF to CRLF while repository is cloned (controlled by core.autocrlf config). When that happens, all test fail due to EOL differences in reference (CRLF) and local (LF) files.

File difference example:

$ xxd baselines/reference/basicLex.lex.baseline

00000000: 5b0d 0a20 205b 0d0a 2020 2020 2249 6465  [..  [..    "Ide
00000010: 6e74 6966 6965 7222 2c0d 0a20 2020 2022  ntifier",..    "
00000020: 7822 0d0a 2020 5d0d 0a5d                 x"..  ]..]

$ xxd baselines/local/basicLex.lex.baseline

00000000: 5b0a 2020 5b0a 2020 2020 2249 6465 6e74  [.  [.    "Ident
00000010: 6966 6965 7222 2c0a 2020 2020 2278 220a  ifier",.    "x".
00000020: 2020 5d0a 5d                               ].]

I've faced this issue on Win 10 Home with Git v2.31.1.windows.1 (Git Bash). On Ubuntu (WSL) all worked fine.