Skip to content
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

Clarify and unify line break behavior #44

Closed
2 tasks done
skuzzle opened this issue Nov 25, 2022 · 0 comments
Closed
2 tasks done

Clarify and unify line break behavior #44

skuzzle opened this issue Nov 25, 2022 · 0 comments

Comments

@skuzzle
Copy link
Owner

skuzzle commented Nov 25, 2022

We have several places where we deal with linebreaks:

  • Text-diff creation
  • Reading snapshot files
  • Writing snapshot files
  • Other assertion exception message text
  • Our default snapshot serializers come with their own rules

There is currently no defined unique behavior about which kind of linebreaks we are using. The matter is complicated by the fact that snapshot files are supposed to be checked into the SCM and Git has its very own idea of dealing with line breaks among different seettings and operation systems.

  • Naturally, snapshot files are to be persisted with the linebreaks generated by the respective SnapshotSerializer
  • Naturally, snapshot files need to be read without losing any line break information (<- impossible due to GIT's beahvior)
  • Text diffs are always to be rendered with system line breaks. Line break changes are either highlighted separately at the beginning of the diff or ignored depending on diff settings
  • Likewise, all exception message text should be rendered with system line breaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant