Skip to content

Conversation

vbreuss
Copy link
Contributor

@vbreuss vbreuss commented Jan 16, 2024

Add the following option to the EquivalencyAssertionOptions<T> for strings

public EquivalencyAssertionOptions<T> IgnoringNewlineStyle()
{
    // This will replace "\r\n" with "\n" in actual and expected before comparison
    return this;
}

This fixes #2612 and fixes #2566

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
    • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

Copy link

github-actions bot commented Jan 16, 2024

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@coveralls
Copy link

coveralls commented Jan 16, 2024

Pull Request Test Coverage Report for Build 8410472005

Details

  • 26 of 26 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.004%) to 97.561%

Totals Coverage Status
Change from base Build 8409735285: 0.004%
Covered Lines: 12024
Relevant Lines: 12208

💛 - Coveralls

@vbreuss vbreuss marked this pull request as ready for review January 20, 2024 05:24
@dennisdoomen dennisdoomen requested a review from jnyrup January 20, 2024 07:04
Copy link

github-actions bot commented Jan 23, 2024

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@ivarne
Copy link

ivarne commented Feb 3, 2024

Another option that would be cool here is to ignore newlines and indentation.

public EquivalencyAssertionOptions<T> IgnoreIndentation()
{
    // This will remove all whitespace after a newline in actual and expected before comparison
    return this;
}

@dennisdoomen
Copy link
Member

@jnyrup will you be able to review this anything soon?

@vbreuss vbreuss changed the title Add options to ignore all newlines and ignore newline style when comparing strings for equivalency Add option to ignore newline style when comparing strings for equivalency Mar 24, 2024
@vbreuss vbreuss marked this pull request as draft March 24, 2024 15:50
@vbreuss vbreuss marked this pull request as ready for review March 24, 2024 15:59
@dennisdoomen dennisdoomen merged commit 767ab78 into fluentassertions:develop Apr 14, 2024
@dennisdoomen
Copy link
Member

Nice!

@vbreuss vbreuss deleted the topic/add-option-to-ignore-newline-differences branch April 15, 2024 05:34
MeikelLP added a commit to MeikelLP/quantum-core-x that referenced this pull request Nov 4, 2024
Bumped FluentAssertions to 7.0.0-alpha.5 for fluentassertions/fluentassertions#2565
MeikelLP added a commit to MeikelLP/quantum-core-x that referenced this pull request Nov 16, 2024
* CHG use keyed options to allow multiple definitions in one app

* CHG make packet provider and related services keyed so they can be registered multiple times and injected by key

* ADD Single executable to host both auth and game in one executable

* feat(single): implement single exe

* refactor(build): renamed Game + Auth to Game.Server + Auth.Server

Executables are now just a tiny wrapper around the library to make QuantumCore.Single not depend on executables (causes many issues with build output)

* feat(ci): single exe

* feat(single): Add commandline parser to allow --version and --help

* chore: Set author to MeikelLP to make auto generated copyright more useful

* refactor(single): Moved Game.Server + Auth.Server to Libraries/ dir

* fix: launchSettings.json

* fix: project references

* feat: Use IFileProvider

Additionally removed the proto loaders and merged them with their respective manager

* refactor(game): Use IFileProvider

* refactor(game): Remove additional config files from data dir

* fix: tests

* refactor(game): Use IFileProvider

* refactor(game): Use IFileProvider

* refactor(game): Use ILoadable

* fix(game): Duplicate service registration

* fix: tests

* fix: startup crash if no data/ dir existed

* docs: renamed API to configuration

* docs: Improve configuration docs

* chore(docs): Add recommended truncate for blog posts

* fix(tests)

Bumped FluentAssertions to 7.0.0-alpha.5 for fluentassertions/fluentassertions#2565

* fix: InMemory cache wrong expiry

* fix(game): service registration

* fix: default IP is loopback

* fix(auth): startup

* fix(tests)

* fix(game): remove unnecessary file IO

* refactor: use constants for "auth" and "game" named options

* chore: cleanup csproj

* fix(single): bump GitVersion.MsBuild to latest to possibly fix CI issue

* fix(ci): unshallow fetch

* fix(ci): unshallow fetch

* fix(single): app launch

* fix(ci): self-contained publish for single

* chore(ci): rename publish artifacts job

* fix(game): ping handler casting wrongly

* chore(docs): clarify the client directory

* fix(ci): run single builds only on master/tag
@Kryptos-FR
Copy link

It seems like while it was included in the 7.0.0-alpha.4, it is not included in the 7.0 release. Why is that? I'm currently facing this exact issue.

@jnyrup
Copy link
Member

jnyrup commented Dec 4, 2024

It seems like while it was included in the 7.0.0-alpha.4, it is not included in the 7.0 release. Why is that? I'm currently facing this exact issue.

See #2864 (comment)

This was referenced Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add string-option for ignoring newline style Incorrect line breaks handling with custom string comparer
8 participants