Skip to content

🛠️Normalize test line endings #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AlexanderOpran
Copy link

Line Endings Normalization in Fixture Tests

Description

Added line endings normalization to fixture tests to ensure consistent comparison between expected and actual outputs across different operating systems.

Problem

image
Test fixtures could fail when run on different operating systems (particularly Windows vs Unix-based systems) due to inconsistent line endings (\r\n vs \n). This caused false negatives in the test suite when the only difference was the line ending style.

Solution

Added a normalizeLineEndings function that converts all Windows-style line endings (\r\n) to Unix-style (\n) before comparing test outputs. This ensures that:

  • Tests are reliable across all operating systems
  • Git's automatic line ending conversion doesn't affect test results
  • We're testing the actual content formatting rather than platform-specific line endings

Testing

  • Verified tests pass on both Windows and Unix-based systems
  • Confirmed that the normalization doesn't affect the actual plugin output
  • Existing test cases remain unchanged in their assertions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant