tlaplus / vscode-tlaplus

TLA+ language support for Visual Studio Code
MIT License
357 stars 33 forks source link

Bug: tests fail on Windows because of CRLF line endings #170

Closed ahelwer closed 4 years ago

ahelwer commented 4 years ago

Currently on Windows all the "Config On Type Formatting Test Suite" tests and the "TLA On Type Formatting Test Suite" tests all fail with errors of this type:

 1) Config On Type Formatting Test Suite
       Indents constants-block body:

      AssertionError [ERR_ASSERTION]: Expected values to be loosely deep-equal:

[
  'CONSTANTS\r',
  '  '
]

should loosely deep-equal

[
  'CONSTANTS',
  '  '
]
      + expected - actual

       [
      -  "CONSTANTS\r"
      +  "CONSTANTS"
         "  "
       ]

        at Object.<anonymous> (c:\Users\ahelwer\source\vscode-tlaplus\out\tests\suite\formatters\formatting.js:26:16)
        at Generator.next (<anonymous>)
        at fulfilled (c:\Users\ahelwer\source\vscode-tlaplus\out\tests\suite\formatters\formatting.js:5:58)
        at processTicksAndRejections (internal/process/task_queues.js:94:5)

This is due to Windows adding the CR (\r) character to line breaks in addition to the LF (\n) character.

alygin commented 4 years ago

Yeah, I've added Windows to the build matrix, and it fails: 1125122153

alygin commented 4 years ago

Windows tests are green again: 1125318149